[LLVMdev] bug or expected behaviour?

Carl Norum carl at lytro.com
Wed Jun 5 13:43:41 PDT 2013


If anyone cares to back me up, I filed a bug and submitted a patch to the OS in question, found here:

	https://sourceforge.net/tracker/?func=detail&aid=3614352&group_id=111543&atid=659633

-- Carl


On Jun 5, 2013, at 7:50 AM, John Regehr <regehr at cs.utah.edu> wrote:

>> The optimizer can therefore conclude that if this program has well-defined behavior, then x can never point to the null pointer constant (since the null pointer constant is not part of any array object). As a result, the "if (!x)" branch would never trigger, and is dead code.
> 
> This is correct: in C you can't create a null pointer by decrementing a valid pointer.  The code in question is dangerous and wrong, and needs to be reviewed to look for other similar problems.
> 
> John
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list