aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-21 20:14:13 +0800
committerGitHub <noreply@github.com>2018-06-21 20:14:13 +0800
commit2c456f0e701ae27b9c00617473b2b21c63f40c86 (patch)
tree127c76f4c4d03dccf67878f92840f57927b97db8 /libsolidity
parent3e9b4383cc42d6bdf09796e52b8816515618e676 (diff)
parenta392e0f0469c711aed5e21b28781de25424d5ab7 (diff)
downloaddexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.tar
dexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.tar.gz
dexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.tar.bz2
dexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.tar.lz
dexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.tar.xz
dexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.tar.zst
dexon-solidity-2c456f0e701ae27b9c00617473b2b21c63f40c86.zip
Merge pull request #4326 from ethereum/compilerstack-cleanup
Properly catch optimizer/assembly exception in CompilerStack
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/interface/CompilerStack.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index a8668336..4e8d1461 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -741,16 +741,20 @@ void CompilerStack::compileContract(
// 16-bit big endian length
cborEncodedMetadata += toCompactBigEndian(cborEncodedMetadata.size(), 2);
- // Run optimiser and compile the contract.
- compiler->compileContract(_contract, _compiledContracts, cborEncodedMetadata);
-
try
{
- compiledContract.object = compiler->assembledObject();
+ // Run optimiser and compile the contract.
+ compiler->compileContract(_contract, _compiledContracts, cborEncodedMetadata);
}
catch(eth::OptimizerException const&)
{
- solAssert(false, "Assembly optimizer exception for bytecode");
+ solAssert(false, "Optimizer exception during compilation");
+ }
+
+ try
+ {
+ // Assemble deployment (incl. runtime) object.
+ compiledContract.object = compiler->assembledObject();
}
catch(eth::AssemblyException const&)
{
@@ -759,12 +763,9 @@ void CompilerStack::compileContract(
try
{
+ // Assemble runtime object.
compiledContract.runtimeObject = compiler->runtimeObject();
}
- catch(eth::OptimizerException const&)
- {
- solAssert(false, "Assembly optimizer exception for deployed bytecode");
- }
catch(eth::AssemblyException const&)
{
solAssert(false, "Assembly exception for deployed bytecode");