Fix bug in code for avoiding dynamic initialization of dllimport globals
authorHans Wennborg <hans@hanshq.net>
Wed, 18 Jun 2014 01:21:33 +0000 (01:21 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 18 Jun 2014 01:21:33 +0000 (01:21 +0000)
commita0ca209303aec31f81154367482d1351f77e8c6d
tree0d636fa9bfff0ac125c9fcc6d46be9ba0e336492
parent5799e291e14a71a12e12b3106f550b28b0beabb6
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
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp