summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-06-18 01:21:33 +0000
committerHans Wennborg <hans@hanshq.net>2014-06-18 01:21:33 +0000
commita0ca209303aec31f81154367482d1351f77e8c6d (patch)
tree0d636fa9bfff0ac125c9fcc6d46be9ba0e336492 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent5799e291e14a71a12e12b3106f550b28b0beabb6 (diff)
downloadbcm5719-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.cpp1
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);
OpenPOWER on IntegriCloud