mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

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
17 lines
328 B
C
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 (;;)
|
|
;
|
|
}
|