Skip to content

Commit

Permalink
fix(EOF): ext*call return values (#1515)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita authored Jun 12, 2024
1 parent 8742fc7 commit 75c3d08
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions crates/interpreter/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
);
}
}
}
Expand Down

0 comments on commit 75c3d08

Please sign in to comment.