From 5a99c49d2e232c3a5076b2f99549ccd595598a4c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 1 Dec 2015 01:10:48 +0000 Subject: Fix use-after-free when a C++ thread_local variable gets replaced (because its type changes when the initializer is attached). Don't hold onto the GlobalVariable*; recompute it from the VarDecl* instead. llvm-svn: 254359 --- clang/lib/CodeGen/CGCXXABI.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGCXXABI.h') diff --git a/clang/lib/CodeGen/CGCXXABI.h b/clang/lib/CodeGen/CGCXXABI.h index 7667361f7b9..3f240b1802b 100644 --- a/clang/lib/CodeGen/CGCXXABI.h +++ b/clang/lib/CodeGen/CGCXXABI.h @@ -538,11 +538,9 @@ public: /// thread_local variables, a list of functions to perform the /// initialization. virtual void EmitThreadLocalInitFuncs( - CodeGenModule &CGM, - ArrayRef> - CXXThreadLocals, + CodeGenModule &CGM, ArrayRef CXXThreadLocals, ArrayRef CXXThreadLocalInits, - ArrayRef CXXThreadLocalInitVars) = 0; + ArrayRef CXXThreadLocalInitVars) = 0; // Determine if references to thread_local global variables can be made // directly or require access through a thread wrapper function. -- cgit v1.2.3