diff --git a/vyper/codegen/ir_node.py b/vyper/codegen/ir_node.py index 9d6770ce81..a253a9278d 100644 --- a/vyper/codegen/ir_node.py +++ b/vyper/codegen/ir_node.py @@ -405,6 +405,8 @@ def gas(self): def is_complex_ir(self): # list of items not to cache. note can add other env variables # which do not change, e.g. calldatasize, coinbase, etc. + # reads (from memory or storage) should not be cached because + # they can have side effects. do_not_cache = {"~empty", "calldatasize", "callvalue"} return (