runtimeverification / iele-semantics

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

Calling nonexisting function causes all contract function to no-op #148

Open SebastienGllmt opened 6 years ago

SebastienGllmt commented 6 years ago

If you call a function that doens't exist, the program still compiles however it seems calling any function does nothing.

Here is a repro


define public @"testBad()"() {
entry:
// note that there is no function called foo in this contract
  %temp = call @foo()
}

define public @"getVal()"() {
entry:
// calling this function returns nothing
  ret 0x0100
}

define @init() {
entry:
  ret void
}

}
dwightguth commented 6 years ago

So, it looks like iele-assemble successfully generates bytecode for this contract, but check-iele shows that the contract is still ill-formed. Probably we want to implicitly check for well-formedness when we assemble the contract, but for now, this is working as intended and the reason you get no return value when you try to call getVal() is because the contract failed to upload due to being ill-formed.

SebastienGllmt commented 6 years ago

I guess the real suggestion would be for the Remix IDE to report error codes when you make a non-blockchain call instead of printing nothing and to make blockchain call errors more visible (esp. not well formed since it visually looks like everything work unless you check the status of your transaction)