teak-llvm/clang/test/CodeGen/loop-info-asan.c
Aaron Ballman b6ab533b93 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.

llvm-svn: 369259
2019-08-19 13:37:41 +00:00

17 lines
328 B
C

// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -o /dev/null
// This test should not exhibit use-after-free in LoopInfo.
int a() {
for (;;)
for (;;)
for (;;)
for (;;)
for (;;)
for (;;)
for (;;)
for (;;)
for (;;)
;
}