aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/CompilerStack.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-11-11 01:16:21 +0800
committerchriseth <c@ethdev.com>2016-11-16 21:37:18 +0800
commite543bd34c0b4884b5a27555f698f50af6a1c0b81 (patch)
treeef2c12e4767a3d38603323212face114213ca4b4 /libsolidity/interface/CompilerStack.cpp
parentee3efa67a8d3eb4077786fd745c1925a916419f5 (diff)
downloaddexon-solidity-e543bd34c0b4884b5a27555f698f50af6a1c0b81.tar.gz
dexon-solidity-e543bd34c0b4884b5a27555f698f50af6a1c0b81.tar.zst
dexon-solidity-e543bd34c0b4884b5a27555f698f50af6a1c0b81.zip
Stored combined creation and runtime tags.
Includes a change to Assembly to allow tags from sub-assemblies to be used. Sorry, this get a bit bigger than I thought.
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r--libsolidity/interface/CompilerStack.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 519027bc..c86de43f 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -37,6 +37,7 @@
#include <libsolidity/interface/InterfaceHandler.h>
#include <libsolidity/formal/Why3Translator.h>
+#include <libevmasm/Exceptions.h>
#include <libdevcore/SHA3.h>
#include <boost/algorithm/string.hpp>
@@ -590,9 +591,19 @@ void CompilerStack::compileContract(
compiledContract.runtimeObject = compiler->runtimeObject();
_compiledContracts[compiledContract.contract] = &compiler->assembly();
- Compiler cloneCompiler(_optimize, _runs);
- cloneCompiler.compileClone(_contract, _compiledContracts);
- compiledContract.cloneObject = cloneCompiler.assembledObject();
+ try
+ {
+ Compiler cloneCompiler(_optimize, _runs);
+ cloneCompiler.compileClone(_contract, _compiledContracts);
+ compiledContract.cloneObject = cloneCompiler.assembledObject();
+ }
+ catch (eth::AssemblyException const& _e)
+ {
+ // In some cases (if the constructor requests a runtime function), it is not
+ // possible to compile the clone.
+
+ // TODO: Report error / warning
+ }
}
std::string CompilerStack::defaultContractName() const