Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SebastienGllmt opened this issue Aug 29, 2018 · 2 comments
Open

Comments

@SebastienGllmt
Copy link

SebastienGllmt commented Aug 29, 2018

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
Copy link

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
Copy link
Author

SebastienGllmt commented Sep 2, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants