Merge pull request #3245 from ivanbakel/removeSolAssert

Remove use of solAssert in Jumpdest optimization
This commit is contained in:
Alex Beregszaszi 2017-11-27 02:48:45 +00:00 committed by GitHub
commit 663ea4b5c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,8 +21,6 @@
#include "JumpdestRemover.h" #include "JumpdestRemover.h"
#include <libsolidity/interface/Exceptions.h>
#include <libevmasm/AssemblyItem.h> #include <libevmasm/AssemblyItem.h>
using namespace std; using namespace std;
@ -45,7 +43,7 @@ bool JumpdestRemover::optimise(set<size_t> const& _tagsReferencedFromOutside)
if (_item.type() != Tag) if (_item.type() != Tag)
return false; return false;
auto asmIdAndTag = _item.splitForeignPushTag(); auto asmIdAndTag = _item.splitForeignPushTag();
solAssert(asmIdAndTag.first == size_t(-1), "Sub-assembly tag used as label."); assertThrow(asmIdAndTag.first == size_t(-1), OptimizerException, "Sub-assembly tag used as label.");
size_t tag = asmIdAndTag.second; size_t tag = asmIdAndTag.second;
return !references.count(tag); return !references.count(tag);
} }