Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Flip CALL result from EEI/POSIX convention to EVM convention #253

Merged
merged 1 commit into from
May 27, 2018

Conversation

axic
Copy link
Member

@axic axic commented May 26, 2018

Pulled out of #246. Part of #184.

Fixes the problem mentioned in #246 (comment)

@axic axic requested a review from cdetrio May 26, 2018 15:52
@axic axic force-pushed the call-result branch 4 times, most recently from c2b811c to 75fcbd0 Compare May 26, 2018 16:34
(func $check_nonzero
(param $a i32)
(result i32)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

(return (i32.eqz (get_local $a)))

Instead of anything after this?

`(i64.store
(i32.add (get_global $sp) (i32.const ${spOffset * 32}))
(i64.extend_u/i32
(call $check_nonzero ${call}) ;; flip CALL result from EVM convention to POSIX convention 0 -> 1 and 1,2,.. -> 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment does not make much sense to me, is it correct? Seems that we are doing 0 -> 1, 1,2,... -> 0 with $check_nonzero.

@axic
Copy link
Member Author

axic commented May 27, 2018

@ehildenb fixed, please review

@axic axic merged commit a9b26e9 into master May 27, 2018
@axic axic deleted the call-result branch May 27, 2018 20:40
@axic axic removed the in progress label May 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants