Displaying 2 results from an estimated 2 matches for "modify_glob".
Did you mean:
modify_global
2013 Nov 11
0
[LLVMdev] Should remove calling NULL pointer or not
I've definitely seen code like the following in various production code
bases:
namespace {
bool global = false;
}
class Foo {
void modify_global() { global = true; }
};
// usually, there's a layer of indirection (or two, or three) here
((Foo*)NULL)->modify_global();
Discussions on StackOverflow seem to clearly indicate that the above
code is undefined. Having said that, I have not tried to parse apart
the actual spec on this...
2013 Nov 07
4
[LLVMdev] Should remove calling NULL pointer or not
Hi,
For a small case, that calls NULL pointer function. LLVM explicitly converts
It to a store because it thinks it is not reachable like calling undefvalue.
In InstCombineCalls.cpp:930
I think it is not a right approach because calling null pointer function
Will segfault the program. Converting to a store will make program pass
Silently. This changes the behavior of a program.