Detect unsafe byval function arguments and move them to the unsafe
stack.
A simple SDAG change required to handle the case of dbg.declare for
a function parameter pointing to neither a function argument nor an
AllocaInst.
Paths
| Differential D14972
[safestack] Protect byval function arguments. ClosedPublic Authored by eugenis on Nov 24 2015, 4:07 PM.
Details
Diff Detail
Event Timelineeugenis updated this object.
Comment Actions There's not much we can do about inallocah because it represents an ABI break if we move them to the unsafe stack. This only affects windows right? Peter Comment Actions Would it be possible to handle inalloca by copying it onto the unsafe stack and then back before the return from the function? We would need to handle exceptional control flow as well, which could be quite complicated. Comment Actions That would break things, unfortunately. Consider this code: A *ptr; struct A { A() { ptr = this; } }; void f(A a) { assert(ptr == &a); } void g() { f(A()); } If we make a copy of a in f, the assertion would fail. This revision is now accepted and ready to land.Nov 30 2015, 4:42 PM
Revision Contents
Diff 41454 include/llvm/Transforms/Utils/Local.h
lib/Transforms/Instrumentation/SafeStack.cpp
lib/Transforms/Utils/Local.cpp
test/Transforms/SafeStack/byval.ll
test/Transforms/SafeStack/debug-loc.ll |
*Arguments