This is an archive of the discontinued LLVM Phabricator instance.

[ASan] fix lifetime intrinsics handling
ClosedPublic

Authored by samsonov on Dec 26 2012, 2:42 AM.

Details

Reviewers
kcc
Summary

Change the way we handle lifetime intrinsics: for each intrinsic check
if it describes one of the "interesting" allocas. Assume that allocas can go through
casts and phi-nodes before appearing as llvm.lifetime arguments.

Diff Detail

Event Timeline

kcc added inline comments.Dec 26 2012, 4:56 AM
lib/Transforms/Instrumentation/AddressSanitizer.cpp
328

do you really need this map?
w/o it things may become simpler

1353

return 0?

samsonov updated this revision to Unknown Object (????).Dec 26 2012, 6:17 AM

Address kcc's comments

lib/Transforms/Instrumentation/AddressSanitizer.cpp
328

Replaced map with a vector of AllocaPoisonCall

1353

Done

kcc added inline comments.Dec 26 2012, 11:55 PM
lib/Transforms/Instrumentation/AddressSanitizer.cpp
328

Maybe like this?
Maps Value to an AllocaInst from which the Value is originated

329

no need for this typedef anymore

1238

do you need this if?
If it's false, the vector will be empty.

1341

Res = AllocaForValue[V]; // Creates a 0 value if there is not such element.
if (Res)

return Res;
samsonov updated this revision to Unknown Object (????).Dec 27 2012, 12:32 AM

Address kcc's comments.

lib/Transforms/Instrumentation/AddressSanitizer.cpp
328

Done

329

See below

1238

Done

1341

This is not equivalent: we should also do an early return if the map contains "0" as the value for key V.

kcc accepted this revision.Dec 27 2012, 12:41 AM

LGTM

r171153, thanks!

samsonov closed this revision.Jan 14 2013, 2:45 AM