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

Multiple Return Value Assertion Violation #232

Open
stephensj2 opened this issue Jan 24, 2020 · 0 comments
Open

Multiple Return Value Assertion Violation #232

stephensj2 opened this issue Jan 24, 2020 · 0 comments

Comments

@stephensj2
Copy link
Collaborator

In Solidity, when a function can return multiple values it is sometimes desirable to declare new variables to store those values. It is possible to do so by declaring the variables inside a tuple like so:
(uint i, uint j) = fn();

However, such a declaration violates an assertion inside of VeriSol resulting in the following output:

Assertion Failed at SolidityAST.VariableDeclarationStatement.Accept(IASTVisitor visitor) in SolidityAST.cs:line 1274

This error message makes it difficult to understand why the translation failed. It would therefore be helpful if this behavior was either explicitly disallowed (similar to low-level calls), or supported by VeriSol. If the behavior were to be disallowed, the user could easily fix the problem by transforming the above code into:
uint i; uint j; (i, j) = fn();

A simple test case that violates this assertion is provided below.

bug1.txt

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

1 participant