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 | c7d7e0cbe0a83881e4a01b0be745e169bd1baea0 (patch) | |
tree | 9f8309dc29adc503fd04011c1332eb63767bd5a7 /lib/MC/MCSectionCOFF.cpp | |
parent | 6745191070503f669b07bc14cd6f7e518bd4d5b0 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCSectionCOFF.cpp')
0 files changed, 0 insertions, 0 deletions