Skip to content

lll: disallow useless PUSHn in assembly#3070

Merged
pirapira merged 1 commit intodevelopfrom
lll-assembly
Oct 18, 2017
Merged

lll: disallow useless PUSHn in assembly#3070
pirapira merged 1 commit intodevelopfrom
lll-assembly

Conversation

@axic
Copy link
Contributor

@axic axic commented Oct 13, 2017

Found in #3002.

BOOST_CHECK(!successCompile("(DUP" + boost::lexical_cast<string>(i) + ")"));
for (unsigned i = 1; i <= 16; i++)
BOOST_CHECK(!successCompile("(SWAP" + boost::lexical_cast<string>(i) + ")"));
BOOST_CHECK(!successCompile("(JUMPDEST)"));
Copy link
Contributor

Choose a reason for hiding this comment

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

@winsvega wanted to use (JUMPDEST) in some tests. He and @axic need to talk.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can still be used via assembly: (asm JUMPDEST). See #3066.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, then it's a non-issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also note it was removed a week ago or so, this PR removes pushnn from assembly and adds tests for the rest too.

Copy link
Contributor

Choose a reason for hiding this comment

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

it is an issue. some tests rely on (JUMPDEST)
and we dont have a unit test that actually checks that all lll opcodes are actually supported by lllc version before running the test fillers.

Copy link
Contributor

Choose a reason for hiding this comment

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

@pirapira what are the options?

Copy link
Contributor

Choose a reason for hiding this comment

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

We build just parser of (opcode) to bytecode.

Copy link
Contributor

Choose a reason for hiding this comment

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

the older version of solidity lllc works just like that. if you suggest to write a new parser...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The older version of lllc is buggy and it produces unreliable output, at least output which we shouldn't rely on in testing the entire ecosystem with.

Copy link
Contributor

Choose a reason for hiding this comment

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

@winsvega either fork an older lllc and fix the bugs, or create a new compiler.

@axic
Copy link
Contributor Author

axic commented Oct 15, 2017

@pirapira @chriseth can we merge this?

@pirapira
Copy link
Contributor

Yes, I think so when the tests pass.

@axic
Copy link
Contributor Author

axic commented Oct 16, 2017

@pirapira the tests failures are not related to this PR

@pirapira
Copy link
Contributor

Restarted the emscripten build.

@axic
Copy link
Contributor Author

axic commented Oct 18, 2017

@pirapira ok to merge?

Copy link
Contributor

@pirapira pirapira left a comment

Choose a reason for hiding this comment

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

Looks good.

@pirapira pirapira merged commit fda8499 into develop Oct 18, 2017
@pirapira pirapira deleted the lll-assembly branch October 18, 2017 10:02
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

Successfully merging this pull request may close these issues.

3 participants