Skip to content

Commit 328c12c

Browse files
authored
fix(db): Set instruction result at outcome insert (#1117)
1 parent 559e096 commit 328c12c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/interpreter/src/interpreter.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ impl Interpreter {
156156
/// - Updates gas costs and records refunds in the interpreter's `gas` field.
157157
/// - May alter `instruction_result` in case of external errors.
158158
pub fn insert_create_outcome(&mut self, create_outcome: CreateOutcome) {
159-
let instruction_result = create_outcome.instruction_result();
159+
self.instruction_result = InstructionResult::Continue;
160160

161+
let instruction_result = create_outcome.instruction_result();
161162
self.return_data_buffer = if instruction_result.is_revert() {
162163
// Save data to return data buffer if the create reverted
163164
create_outcome.output().to_owned()
@@ -213,6 +214,7 @@ impl Interpreter {
213214
shared_memory: &mut SharedMemory,
214215
call_outcome: CallOutcome,
215216
) {
217+
self.instruction_result = InstructionResult::Continue;
216218
let out_offset = call_outcome.memory_start();
217219
let out_len = call_outcome.memory_length();
218220

@@ -314,7 +316,6 @@ impl Interpreter {
314316
FN: Fn(&mut Interpreter, &mut H),
315317
{
316318
self.next_action = InterpreterAction::None;
317-
self.instruction_result = InstructionResult::Continue;
318319
self.shared_memory = shared_memory;
319320
// main loop
320321
while self.instruction_result == InstructionResult::Continue {

0 commit comments

Comments
 (0)