This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Don't keep stale pointers to LoopInfos
ClosedPublic

Authored by ebevhan on Aug 14 2019, 2:30 AM.

Details

Reviewers
aaron.ballman
Summary

CGLoopInfo was keeping pointers to parent loop LoopInfos,
but when the loop info vector grew, it reallocated the
storage and invalidated all of the parent pointers, causing
use-after-free.

Manage the lifetimes of the LoopInfos separately so that
the pointers aren't stale.

Diff Detail

Event Timeline

ebevhan created this revision.Aug 14 2019, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2019, 2:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Ka-Ka added a subscriber: Ka-Ka.Aug 14 2019, 4:41 AM
This revision is now accepted and ready to land.Aug 14 2019, 8:47 AM

Thanks!

I don't have commit access, so it would be great if you could commit this for me.

aaron.ballman closed this revision.Aug 19 2019, 6:39 AM

I've commit for you in r369259, thank you for the patch!