Skip to content

Commit 95bde80

Browse files
authored
Update lib/Interpreter/CppInterOp.cpp
1 parent 35346a7 commit 95bde80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Interpreter/CppInterOp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,8 +1249,12 @@ namespace Cpp {
12491249
if (!address)
12501250
address = I.getAddressOfGlobal(GD);
12511251
if (!address) {
1252-
if (!VD->hasInit())
1252+
if (!VD->hasInit()) {
1253+
#ifdef USE_CLING
1254+
cling::Interpreter::PushTransactionRAII RAII(&getInterp());
1255+
#endif // USE_CLING
12531256
getSema().InstantiateVariableDefinition(SourceLocation(), VD);
1257+
}
12541258
if (VD->hasInit() &&
12551259
(VD->isConstexpr() || VD->getType().isConstQualified())) {
12561260
if (const APValue* val = VD->evaluateValue()) {

0 commit comments

Comments
 (0)