This commit is contained in:
Alexander Aleksandrovič Klimov 2026-05-21 15:54:51 +00:00 committed by GitHub
commit fd212c3a7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,6 +39,8 @@ void Expression::ScriptBreakpoint(ScriptFrame& frame, ScriptError *ex, const Deb
ExpressionResult Expression::Evaluate(ScriptFrame& frame, DebugHint *dhint) const
{
ExpressionResult result (Empty);
try {
#ifdef I2_DEBUG
/* std::ostringstream msgbuf;
@ -49,11 +51,15 @@ ExpressionResult Expression::Evaluate(ScriptFrame& frame, DebugHint *dhint) cons
frame.IncreaseStackDepth();
Defer decreaseStackDepth([&frame]{
try {
result = DoEvaluate(frame, dhint);
} catch (...) {
frame.DecreaseStackDepth();
});
throw;
}
frame.DecreaseStackDepth();
ExpressionResult result = DoEvaluate(frame, dhint);
return result;
} catch (ScriptError& ex) {
ScriptBreakpoint(frame, &ex, GetDebugInfo());