http://llvm.org/bugs/show_bug.cgi?id=8670
Chris Lattner <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #1 from Chris Lattner <[email protected]> 2010-11-22 23:19:20 CST --- It's not obvious, but this is because your program has undefined behavior. This line: struct IntContainer *a = (void *)((char *)(list->next) - ((char *)&a->link - (char *)(a))); contains a dereference of a->link before a is set. Since a contains an uninitialized variable, a->link and a are not guaranteed to have related values. This is more complex but equivalent to: int a; print(a-a) which is not guaranteed to print zero. -- Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
