This is an archive of the discontinued LLVM Phabricator instance.

Account for stack redzone when computing sp on darwin
ClosedPublic

Authored by fjricci on May 10 2017, 1:42 PM.

Details

Summary

thread_get_register_pointer_values handles the redzone computation
automatically, but is marked as an unavailable API function. This
patch replicates its logic accounting for the stack redzone on
x86_64.

Should fix flakiness in the use_stack_threaded test for lsan on darwin.

Event Timeline

fjricci created this revision.May 10 2017, 1:42 PM
kcc added a subscriber: kcc.May 10 2017, 1:49 PM

Whenever possible, prefer if() to #if
In this case, there is a SANITIZER_ macro for this condition.

Ah, okay, I didn't realize that aarch64 has a redzone as well (thread_get_register_pointer_values is only for x86). Will update.

fjricci updated this revision to Diff 98630.May 11 2017, 8:01 AM

Remove ifdef

fjricci updated this revision to Diff 98631.May 11 2017, 8:01 AM

Remove accidental inclusion of extra files

alekseyshl accepted this revision.May 11 2017, 2:01 PM
This revision is now accepted and ready to land.May 11 2017, 2:01 PM
fjricci closed this revision.EditedMay 15 2017, 7:31 AM

Committed as rL302898