Skip to content

Commit 9dd150e

Browse files
Agusrodrigirazoki
authored andcommitted
more changes
1 parent 47370fe commit 9dd150e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/executor/stack/executor.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,15 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
327327
kind: RuntimeKind::Execute,
328328
inner: MaybeBorrowed::Borrowed(runtime),
329329
});
330-
let (reason, _, _) = self.execute_with_call_stack(&mut call_stack);
330+
let (reason, _, _) = self.execute_with_call_stack(&mut call_stack, None);
331331
reason
332332
}
333333

334334
/// Execute using Runtimes on the call_stack until it returns.
335335
fn execute_with_call_stack(
336336
&mut self,
337337
call_stack: &mut Vec<TaggedRuntime<'_>>,
338+
caller: Option<H160>,
338339
) -> (ExitReason, Option<H160>, Vec<u8>) {
339340
// This `interrupt_runtime` is used to pass the runtime obtained from the
340341
// `Capture::Trap` branch in the match below back to the top of the call stack.
@@ -378,6 +379,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
378379
created_address,
379380
reason,
380381
runtime.inner.machine().return_value(),
382+
caller,
381383
);
382384
(reason, maybe_address, return_data)
383385
}
@@ -486,7 +488,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
486488
Capture::Trap(rt) => {
487489
let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY);
488490
cs.push(rt.0);
489-
let (s, _, v) = self.execute_with_call_stack(&mut cs);
491+
let (s, _, v) = self.execute_with_call_stack(&mut cs, None);
490492
emit_exit!(s, v)
491493
}
492494
}
@@ -544,7 +546,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
544546
Capture::Trap(rt) => {
545547
let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY);
546548
cs.push(rt.0);
547-
let (s, _, v) = self.execute_with_call_stack(&mut cs);
549+
let (s, _, v) = self.execute_with_call_stack(&mut cs, None);
548550
emit_exit!(s, v)
549551
}
550552
}
@@ -675,7 +677,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
675677
Capture::Trap(rt) => {
676678
let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY);
677679
cs.push(rt.0);
678-
let (s, _, v) = self.execute_with_call_stack(&mut cs);
680+
let (s, _, v) = self.execute_with_call_stack(&mut cs, Some(caller));
679681
emit_exit!(s, v)
680682
}
681683
}
@@ -1028,6 +1030,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
10281030
created_address: H160,
10291031
reason: ExitReason,
10301032
return_data: Vec<u8>,
1033+
caller: Option<H160>
10311034
) -> (ExitReason, Option<H160>, Vec<u8>) {
10321035
fn check_first_byte(config: &Config, code: &[u8]) -> Result<(), ExitError> {
10331036
if config.disallow_executable_format && Some(&Opcode::EOFMAGIC.as_u8()) == code.first()
@@ -1526,7 +1529,7 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle
15261529
let mut call_stack = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY);
15271530
call_stack.push(rt.0);
15281531
let (reason, _, return_data) =
1529-
self.executor.execute_with_call_stack(&mut call_stack);
1532+
self.executor.execute_with_call_stack(&mut call_stack, None);
15301533
emit_exit!(reason, return_data)
15311534
}
15321535
}

0 commit comments

Comments
 (0)