diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-08 22:15:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-08 22:15:59 +0000 |
commit | 84d461865965192f7a71627887a0ea8e5dd5afb7 (patch) | |
tree | 506d50e42f41094c4855c3d67f2716e5b185172a /clang/lib/Sema | |
parent | 2ec6cff9d05383a88a6c5f78952993247f5c4f01 (diff) | |
download | bcm5719-llvm-84d461865965192f7a71627887a0ea8e5dd5afb7.tar.gz bcm5719-llvm-84d461865965192f7a71627887a0ea8e5dd5afb7.zip |
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
Diffstat (limited to 'clang/lib/Sema')
0 files changed, 0 insertions, 0 deletions