This is an archive of the discontinued LLVM Phabricator instance.

Don't try to instrument allocas used by outlined SEH funclets
ClosedPublic

Authored by rnk on Jul 17 2015, 1:02 PM.

Details

Summary

Arguments to llvm.localescape must be static allocas. They must be at
some statically known offset from the frame or stack pointer so that
other functions can access them with localrecover.

If we ever want to instrument these, we can use more indirection to
recover the addresses of these local variables. We can do it during
clang irgen or with the asan module pass.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 30023.Jul 17 2015, 1:02 PM
rnk retitled this revision from to Don't try to instrument allocas used by outlined SEH funclets.
rnk updated this object.
rnk added a reviewer: eugenis.
rnk added a subscriber: llvm-commits.
eugenis edited edge metadata.Jul 17 2015, 1:20 PM

LGTM, but please wait for kcc or samsonov review.
This code changed quite a bit since I last looked at it.

test/Instrumentation/AddressSanitizer/localescape.ll
1 ↗(On Diff #30023)

Add a test without -asan-use-after-return?
It should not be any different, but who knows.

samsonov accepted this revision.Jul 17 2015, 5:12 PM
samsonov edited edge metadata.

LGTM

lib/Transforms/Instrumentation/AddressSanitizer.cpp
560 ↗(On Diff #30023)

You can find llvm.localescape in FunctionStackPoisoner::visitIntrinsicInst rather than pass it around.

This revision is now accepted and ready to land.Jul 17 2015, 5:12 PM
rnk marked an inline comment as done.Jul 20 2015, 3:42 PM

thanks!

lib/Transforms/Instrumentation/AddressSanitizer.cpp
560 ↗(On Diff #30023)

Sure.

test/Instrumentation/AddressSanitizer/localescape.ll
1 ↗(On Diff #30023)

OK.

This revision was automatically updated to reflect the committed changes.
rnk marked an inline comment as done.