You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I couldn't find an example program that leads to such a deep with statement. It might not be possible at this moment, but it would be good to fix for later.
How can it be fixed?
Add the following check in the case of code.value == "set":
if height - withargs[code.args[0].value] > 16:
raise Exception("With statement too deep")
What's your issue about?
Inconsistency in checking invalid cases in
compile_lll.py
.For the
with
variable lookup, it rejects immediately when thewith
statement is too deep:https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/compile_lll.py#L50-L54
but for the
with
variable update, it does not check at all, which may lead to generate an invalid/wrong opcode (e.g., if the depth is 17, then internally it will generateSWAP17
(doesn't exist) that will end up being encoded as0xa0
, which isLOG0
):https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/compile_lll.py#L55-L60
However, I couldn't find an example program that leads to such a deep
with
statement. It might not be possible at this moment, but it would be good to fix for later.How can it be fixed?
Add the following check in the case of
code.value == "set"
:Cute Animal Picture
The text was updated successfully, but these errors were encountered: