-
Notifications
You must be signed in to change notification settings - Fork 80
Check real stack changes inside function vs its definition #302
base: main
Are you sure you want to change the base?
Check real stack changes inside function vs its definition #302
Conversation
Opcode::Push30 => (0, 1), | ||
Opcode::Push31 => (0, 1), | ||
Opcode::Push32 => (0, 1), | ||
Opcode::Dup1 => (1, 2), |
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.
these dup and swap look wrong
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.
agree, followed blindlly evm.codes :/ here different context
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.
force-pushed the fix
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.
@devtooligan was testing it against elohim contract and indeed we need those numbers
if inside macro I would first do swap1 then, I need to be sure that stack is having at least 2 elements
61241ef
to
28020a4
Compare
28020a4
to
c562b98
Compare
ab98df2
to
43d3f4c
Compare
43d3f4c
to
6c32e66
Compare
This PR introduces compiler error on incorrect takes/returns specification for huff functions as this produces broken bytecode.
Related research https://twitter.com/igorlineee/status/1699206608994078949
Missing tests yet, but would like to know opinions on my implementation.