llvm-project/llvm/lib/Transforms
Chris Lattner 84d4618659 make simplifycfg insert an llvm.trap before the 'unreachable' it introduces
when it detects undefined behavior.  llvm.trap generally codegens into some
thing really small (e.g. a 2 byte ud2 instruction on x86) and debugging this
sort of thing is "nontrivial".  For example, we now compile:

void foo() { *(int*)0 = 42; }

into:

_foo:
	pushl	%ebp
	movl	%esp, %ebp
	ud2

Some may even claim that this is a security hole, though that seems dubious
to me.  This addresses rdar://7958343 - Optimizing away null dereference 
potentially allows arbitrary code execution

llvm-svn: 103356
2010-05-08 22:15:59 +00:00
..
Hello Prune #includes. 2010-03-01 17:42:17 +00:00
IPO revert r102831. We already delete dead readonly calls in 2010-05-01 17:19:38 +00:00
InstCombine Teach instcombine to transform a bitcast/(zext|trunc)/bitcast sequence 2010-05-08 21:50:26 +00:00
Instrumentation Revert 101465, it broke internal OpenGL testing. 2010-04-16 23:37:20 +00:00
Scalar make simplifycfg insert an llvm.trap before the 'unreachable' it introduces 2010-05-08 22:15:59 +00:00
Utils Wrap const MDNode * inside DIDescriptor. 2010-05-07 20:54:48 +00:00
Makefile Revert r100896 and around - this breaks the only mingw32 buildbot we have. 2010-04-15 19:51:42 +00:00