Skip to content

Commit 87114a5

Browse files
author
kr-2003
committed
fixed c-api for undo
1 parent ca27ea6 commit 87114a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Interpreter/CXCppInterOp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ TInterp_t clang_Interpreter_takeInterpreterAsPtr(CXInterpreter I) {
306306

307307
enum CXErrorCode clang_Interpreter_undo(CXInterpreter I, unsigned int N) {
308308
#ifdef CPPINTEROP_USE_CLING
309-
return CXError_Failure;
309+
auto* interp = getInterpreter(I);
310+
cling::Interpreter::PushTransactionRAII RAII(interp);
311+
interp->unload(N);
312+
return CXError_Success;
310313
#else
311314
return getInterpreter(I)->Undo(N) ? CXError_Failure : CXError_Success;
312315
#endif // CPPINTEROP_USE_CLING

0 commit comments

Comments
 (0)