runtimeverification / iele-semantics

Semantics of Virtual Machine for IELE prototype blockchain
Other
131 stars 33 forks source link

code cell is populated before initialization code runs #300

Closed theo25 closed 3 years ago

theo25 commented 3 years ago

This PR moves the initialization of the <code> cell before the execution of initialization code, so that instructions such as calladdress that need the cell have it available.

dwightguth commented 3 years ago

Question: does the intialization of the code cell still get reverted with this change if the constructor raises an exception?

theo25 commented 3 years ago

@dwightguth I think so. We call #pushWorldState before any initialization code runs and before the code cell gets populated even with this change. And if there is some exception, #popWorldState should revert the initialization of the code cell.