This is an archive of the discontinued LLVM Phabricator instance.

Reuse code for calculating allocation size for alloca
AbandonedPublic

Authored by bjope on Jun 26 2018, 7:11 AM.

Details

Reviewers
None
Summary

The AllocaInst class now got two methods for calculating the
allocation size for the alloca (in bits and in bytes).

This include minor refactoring in SafeStack, AddressSanitizer
and HWAddressSanitizer to use those methods.

Diff Detail

Event Timeline

bjope created this revision.Jun 26 2018, 7:11 AM
bjope added inline comments.Jul 2 2018, 4:42 AM
lib/Transforms/Instrumentation/AddressSanitizer.cpp
625

This method is used like this:

((!AI.isStaticAlloca()) || getAllocaSizeInBytes(AI) > 0)

So I am afraid this assert might blow (the old assert was guarded by AI.isArrayAllocation()).

bjope abandoned this revision.Apr 12 2023, 2:39 AM

This was an old idea that I never moved forward with. And I think the related code has been refactored since this review was created, so I'll just abandon the review.

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 12 2023, 2:39 AM