-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add support for PUSH0 instruction to debugger & disassembler #5898
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 |
---|---|---|
|
@@ -1014,9 +1014,7 @@ function constructorOutputAllocation( | |
if (contractKind === "library") { | ||
//note: I am relying on this being present! | ||
//(also this part is a bit HACKy) | ||
const pushAddressInstruction = (0x60 + Evm.Utils.ADDRESS_SIZE - 1).toString( | ||
16 | ||
); //"73" | ||
const pushAddressInstruction = (0x5f + Evm.Utils.ADDRESS_SIZE).toString(16); //"73" | ||
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. Note, this calculation is used in three places across two modules, adding error-prone maintenance complexity. 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. There's not really any maintenance complexity here? Like there's nothing here that needs to be updated. I just changed the base of the calculation from Note of course I could have just used a literal 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. I meant that if a new opcode is updated to be base, future maintainers would have three places to update. However, what can come before PUSH0, as you pointed out? :) |
||
const delegateCallGuardString = | ||
"0x" + pushAddressInstruction + "..".repeat(Evm.Utils.ADDRESS_SIZE); | ||
if (binary.startsWith(delegateCallGuardString)) { | ||
|
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 comment above is confusing.
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.
Yeah, didn't really know what to change it to though... (thoughts?)
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.
Beginning of push op codes
maybe?