Remove use of solAssert in Jumpdest optimization#3245
Merged
axic merged 1 commit intoargotorg:developfrom Nov 27, 2017
Merged
Conversation
This is the only use of solAssert in libevmasm, and the only dependency on libsolidity. There is no justification for why the illegal state is checked here.
axic
approved these changes
Nov 27, 2017
Contributor
|
Thanks! That was an oversight added lately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
I was looking into existing LLL implementations, and Solidity's one is nearly perfect enough to use as a standalone library. There is one problem - you can't currently build it without
libsolidity, because of one line of code.Changes
Replaced a use of
solAssertwith anassertThrow(..., OptimizerException, ...).Removed the inclusion of a
libsolidityheader.Reasoning
There's no reason for this to be a
solAssert- it's not directly inlibsolidityorsolc,libevmasmis otherwise totally decoupled from Solidity proper, and there's no justification for why this represents a Solidity compiler error instead of a problem with the assembly optimizer directly.There's not really an explanation for why this illegal state is checked here at all, but I didn't wan't to remove the Exception entirely, because presumably it was motivated by something.