llvm-project/llvm/lib
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
..
Analysis Remove DIGlobal. 2010-05-07 23:19:07 +00:00
Archive silence a warning, patch by "mike". 2010-04-25 04:44:26 +00:00
AsmParser Remove the API compatibility layer which converted add, sub, and mul 2010-05-03 22:44:19 +00:00
Bitcode Revert 101465, it broke internal OpenGL testing. 2010-04-16 23:37:20 +00:00
CodeGen Instead of just verifying compile unit, verify entire type, variable, namespace etc.. 2010-05-07 23:33:41 +00:00
CompilerDriver Use FindExecutable as a fall-back search method. 2010-03-05 04:46:28 +00:00
ExecutionEngine Remove the -enable-sjlj-eh option, which doesn't do anything. 2010-05-02 15:36:26 +00:00
Linker Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some 2010-02-16 14:50:09 +00:00
MC break coff symbol definition stuff out into proper MCStreamer callbacks, 2010-05-08 19:54:22 +00:00
Support Run interrupt routines as part of report_fatal_error, since we are failing 2010-05-08 02:10:36 +00:00
System Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup 2010-05-08 02:10:34 +00:00
Target break coff symbol definition stuff out into proper MCStreamer callbacks, 2010-05-08 19:54:22 +00:00
Transforms make simplifycfg insert an llvm.trap before the 'unreachable' it introduces 2010-05-08 22:15:59 +00:00
VMCore Minimally fix this code to not abort on mdnodes with integer data 2010-05-07 22:15:24 +00:00
Makefile remove llvm-db: it is completely broken and if anyone wants to do a debugger, 2009-10-05 02:29:51 +00:00