Skip to content

Commit

Permalink
fix(server): Reset interpreter stack on errors
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
  • Loading branch information
dranikpg committed Feb 2, 2023
1 parent 68edcf0 commit cf9c2b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/server/main_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ void Service::EvalInternal(const EvalArgs& eval_args, Interpreter* interpreter,
[cntx, this](CmdArgList args, ObjectExplorer* reply) { CallFromScript(args, reply, cntx); });

Interpreter::RunResult result = interpreter->RunFunction(eval_args.sha, &error);
absl::Cleanup clean = [interpreter]() { interpreter->ResetStack(); };

cntx->conn_state.script_info.reset(); // reset script_info

Expand All @@ -1046,8 +1047,6 @@ void Service::EvalInternal(const EvalArgs& eval_args, Interpreter* interpreter,
} else {
interpreter->SerializeResult(&ser);
}

interpreter->ResetStack();
}

void Service::Discard(CmdArgList args, ConnectionContext* cntx) {
Expand Down

0 comments on commit cf9c2b0

Please sign in to comment.