Skip to content

Remove use of solAssert in Jumpdest optimization#3245

Merged
axic merged 1 commit intoargotorg:developfrom
ivanbakel:removeSolAssert
Nov 27, 2017
Merged

Remove use of solAssert in Jumpdest optimization#3245
axic merged 1 commit intoargotorg:developfrom
ivanbakel:removeSolAssert

Conversation

@ivanbakel
Copy link
Contributor

@ivanbakel ivanbakel commented Nov 25, 2017

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 solAssert with an assertThrow(..., OptimizerException, ...).
Removed the inclusion of a libsolidity header.

Reasoning

There's no reason for this to be a solAssert - it's not directly in libsolidity or solc, libevmasm is 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.

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
Copy link
Contributor

axic commented Nov 27, 2017

Thanks! That was an oversight added lately.

@axic axic merged commit 663ea4b into argotorg:develop Nov 27, 2017
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.

2 participants