-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add traceback to VmException #657
Conversation
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.
Few minor comments but should be good to ship.
src/types/instruction.rs
Outdated
@@ -78,3 +81,38 @@ impl Instruction { | |||
} | |||
} | |||
} | |||
|
|||
// Returns True if the given instruction looks like a call instruction. | |||
pub(crate) fn is_call_instruction(encoded_instruction: &BigInt, imm: Option<BigInt>) -> bool { |
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 is encoded_instruction
a BigInt
?
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.
Maybe use an Option<&BigInt>
for the immediate?
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.
encoded_instruction
was left as a BigInt in order to reduce the complexity of get_traceback_entries
. is_call_instruction
is only used inside get_traceback_entries
., which is on the longer side, so it was a bit more convenient to have the type conversion inside the simpler method is_call_instruction
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.
Added reference to immediate
argument in is_call_instruction
and decode_instruction
traceback
field toVmException
The following will be added in a later PR:
get_error_attr_value
by adding the methodsubstitute_error_message_references
.This PR will not add/process the following information:
This may be added in the future in terms of priority