-
Notifications
You must be signed in to change notification settings - Fork 409
Fix: explicit EVM call stack #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| use crate::{ExitFatal, Handler, Runtime}; | ||
| use crate::{Handler, Runtime}; | ||
|
|
||
| /// Interrupt resolution. | ||
| pub enum Resolve<'a, 'config, H: Handler> { | ||
|
|
@@ -10,40 +10,22 @@ pub enum Resolve<'a, 'config, H: Handler> { | |
|
|
||
| /// Create interrupt resolution. | ||
| pub struct ResolveCreate<'a, 'config> { | ||
| runtime: &'a mut Runtime<'config>, | ||
| _runtime: &'a mut Runtime<'config>, | ||
| } | ||
|
|
||
| impl<'a, 'config> ResolveCreate<'a, 'config> { | ||
| pub(crate) fn new(runtime: &'a mut Runtime<'config>) -> Self { | ||
| Self { runtime } | ||
| } | ||
| } | ||
|
|
||
| impl<'a, 'config> Drop for ResolveCreate<'a, 'config> { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably they can be removed entirely, yes. I think it should be done as a follow-up PR to keep the diff on this PR minimal. |
||
| fn drop(&mut self) { | ||
| self.runtime.status = Err(ExitFatal::UnhandledInterrupt.into()); | ||
| self.runtime | ||
| .machine | ||
| .exit(ExitFatal::UnhandledInterrupt.into()); | ||
| Self { _runtime: runtime } | ||
| } | ||
| } | ||
|
|
||
| /// Call interrupt resolution. | ||
| pub struct ResolveCall<'a, 'config> { | ||
| runtime: &'a mut Runtime<'config>, | ||
| _runtime: &'a mut Runtime<'config>, | ||
| } | ||
|
|
||
| impl<'a, 'config> ResolveCall<'a, 'config> { | ||
| pub(crate) fn new(runtime: &'a mut Runtime<'config>) -> Self { | ||
| Self { runtime } | ||
| } | ||
| } | ||
|
|
||
| impl<'a, 'config> Drop for ResolveCall<'a, 'config> { | ||
| fn drop(&mut self) { | ||
| self.runtime.status = Err(ExitFatal::UnhandledInterrupt.into()); | ||
| self.runtime | ||
| .machine | ||
| .exit(ExitFatal::UnhandledInterrupt.into()); | ||
| Self { _runtime: runtime } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no keep using
push_u256!andpush!macros?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
push*macros return theControlstructure, whereas in this function I want to return theExitReasondirectly.