]> granicus.if.org Git - clang/commit
Don't keep stale pointers to LoopInfos.
authorAaron Ballman <aaron@aaronballman.com>
Mon, 19 Aug 2019 13:37:41 +0000 (13:37 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 19 Aug 2019 13:37:41 +0000 (13:37 +0000)
commite03316caa048bdac650cfe0f61274677fe9b6ee4
tree408218630a73a078bbacad6bc11f209ed2f0975f
parent3d1db37fe96afd56c36906a68e736f20311a4fce
Don't keep stale pointers to LoopInfos.

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.

Patch by Bevin Hansson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369259 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGLoopInfo.cpp
lib/CodeGen/CGLoopInfo.h
test/CodeGen/loop-info-asan.c [new file with mode: 0644]