4 ms·
The problem is that if the code looks like this: if (object.some_field != null) { some_unrelated_call(); object.some_fie
by ssp 15y ago
The problem is that if the code looks like this:
if (object.some_field != null) {
some_unrelated_call();
object.some_field.foo();
}
proving that some_unrelated_call() didn't set object.some_field to null is very difficult.
- kenjackson 15y agoIn general, it's also difficult to prove that 'object' doesn't get set to null too.
- ssp 15y agoDepends on what you mean by "general", I suppose, but if 'object' is a local variable in a Java-ish language, then there is a fairly straightforward data flow analysis that can do a good conservative estimate.
- kenjackson 15y agobut if 'object' is a local variable in a Java-ish language, then there is a fairly straightforward data flow analysis that can do a good But if it's not, and/or if it can be adress taken...