From 75c3d0837f4beb607ddbe8251fad6386aa891c44 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 12 Jun 2024 10:15:21 +0200 Subject: [PATCH] fix(EOF): ext*call return values (#1515) --- crates/interpreter/src/interpreter.rs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/crates/interpreter/src/interpreter.rs b/crates/interpreter/src/interpreter.rs index 9c7872c2ba..4c3f6b841f 100644 --- a/crates/interpreter/src/interpreter.rs +++ b/crates/interpreter/src/interpreter.rs @@ -264,18 +264,39 @@ impl Interpreter { self.gas.erase_cost(out_gas.remaining()); self.gas.record_refund(out_gas.refunded()); shared_memory.set(out_offset, &self.return_data_buffer[..target_len]); - push!(self, U256::from(1)); + push!( + self, + if self.is_eof { + U256::ZERO + } else { + U256::from(1) + } + ); } return_revert!() => { self.gas.erase_cost(out_gas.remaining()); shared_memory.set(out_offset, &self.return_data_buffer[..target_len]); - push!(self, U256::ZERO); + push!( + self, + if self.is_eof { + U256::from(1) + } else { + U256::ZERO + } + ); } InstructionResult::FatalExternalError => { panic!("Fatal external error in insert_call_outcome"); } _ => { - push!(self, U256::ZERO); + push!( + self, + if self.is_eof { + U256::from(2) + } else { + U256::ZERO + } + ); } } }