> Does it realistically ever not crash though?

It depends on the system, optimization level, what `NULL` actually is, and so 
on. For example, when the optimizer sees `doc->file_name` without any check 
that it's not `NULL` guarding it, it is free to re-write/optimize that code any 
way it sees fit, as long as the result is the same. It's possible that what it 
produces will do something different than segfault if `doc` ends up actually 
being `NULL`.

As to how likely/realistic it is, I cannot say, but it's never good to rely on 
undefined behaviour.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1537#issuecomment-315543599

Reply via email to