diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-18 01:21:33 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-18 01:21:33 +0000 |
commit | a0ca209303aec31f81154367482d1351f77e8c6d (patch) | |
tree | 0d636fa9bfff0ac125c9fcc6d46be9ba0e336492 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 5799e291e14a71a12e12b3106f550b28b0beabb6 (diff) | |
download | bcm5719-llvm-a0ca209303aec31f81154367482d1351f77e8c6d.tar.gz bcm5719-llvm-a0ca209303aec31f81154367482d1351f77e8c6d.zip |
Fix bug in code for avoiding dynamic initialization of dllimport globals
When instantiating dllimport variables with dynamic initializers, don't
bail out of Sema::InstantiateVariableInitializer without calling
PopExpressionEvaluationContext().
This was causing a stale object to stay on the ExprEvalContexts stack,
causing subsequent calls to getCurrentMangleNumberContext() to fail,
resulting in incorrect numbering of static locals (and probably other
broken things).
llvm-svn: 211137
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index bce2fd552e3..29a10d0daac 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3688,7 +3688,6 @@ void Sema::InstantiateVariableInitializer( if (Var->hasAttr<DLLImportAttr>() && InitExpr && !InitExpr->isConstantInitializer(getASTContext(), false)) { // Do not dynamically initialize dllimport variables. - return; } else if (InitExpr) { bool DirectInit = OldVar->isDirectInit(); AddInitializerToDecl(Var, InitExpr, DirectInit, TypeMayContainAuto); |