Conversation
| AbstractAssembly::LabelID end = m_assembly.newLabelId(); | ||
| m_assembly.appendJumpToIf(end); | ||
| (*this)(_if.body); | ||
| m_assembly.setSourceLocation(_if.location); |
There was a problem hiding this comment.
Shouldn't the sourcelocation be before the body or even the condition?
There was a problem hiding this comment.
Hm, the source location of the label is correct, but what is wrong is the source location of the ISZERO and the jump above.
|
I think this is missing the evm1.5 codegen part? |
|
No, AbstractAssembly handles both of them. |
Never mind, it is |
axic
left a comment
There was a problem hiding this comment.
Please include the if statement in the formal spec
6f4ac0e to
239e456
Compare
|
It is lacking tests:
Though it seems |
|
There is and end-to-end test for if - do we have an "assemble test suite"? |
|
|
|
Tests added. |
test/libjulia/Parser.cpp
Outdated
|
|
||
| BOOST_AUTO_TEST_CASE(if_statement) | ||
| { | ||
| BOOST_CHECK(successParse("{ if 42:u256 {} }")); |
There was a problem hiding this comment.
Hmm, shouldn't in Julia this operate on boolean? if true:bool {}. It currently has a hidden behaviour of if iszero(cond) {}
There was a problem hiding this comment.
I can change the test, but we do not yet enforce types anyway, right?
There was a problem hiding this comment.
No, not yet. It is fine to leave as it is, we'll at least see if the enforcement triggers this failure :)
There was a problem hiding this comment.
I see you've updated it, it is fine that way too.
docs/julia.rst
Outdated
| G, L, continue | ||
| E(G, L, <if condition body>: If) = | ||
| let G0, L0, v = E(G, L, condition) | ||
| if v is true or non-zero: |
There was a problem hiding this comment.
This part is about julia, I think that is more strict and only considers if v is true.
|
Updated. |
|
Perhaps we're failing zeppelin tests now as they've checking for even warnings: |
|
@axic hm, I fear we have to patch that out, we cannot wait for modified zeppelin code when we introduce a new warning. |
|
Test failures are due to the Zeppelin issue. This should be fine to merge though as everything else works and it only adds the |
This will be much more useful in the ABI decoder (only the encoder is part of develop as of now).