aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-11-14 19:58:04 +0800
committerchriseth <chris@ethereum.org>2018-01-19 23:27:44 +0800
commit6807010dc7864500d89a833e4f6e7f338e58b948 (patch)
tree90fa3b3d59ae85a752dc611b6a32e24fe91e9efb /libevmasm/Assembly.cpp
parent33723c457a99213a545006162112b55351da5fe4 (diff)
downloaddexon-solidity-6807010dc7864500d89a833e4f6e7f338e58b948.tar.gz
dexon-solidity-6807010dc7864500d89a833e4f6e7f338e58b948.tar.zst
dexon-solidity-6807010dc7864500d89a833e4f6e7f338e58b948.zip
Prevent libraries from being called.
Diffstat (limited to 'libevmasm/Assembly.cpp')
-rw-r--r--libevmasm/Assembly.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 5fab24e1..b9fedf26 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -283,6 +283,11 @@ Json::Value Assembly::assemblyJSON(StringMap const& _sourceCodes) const
createJsonValue("PUSHLIB", i.location().start, i.location().end, m_libraries.at(h256(i.data())))
);
break;
+ case PushDeployTimeAddress:
+ collection.append(
+ createJsonValue("PUSHDEPLOYADDRESS", i.location().start, i.location().end)
+ );
+ break;
case Tag:
collection.append(
createJsonValue("tag", i.location().start, i.location().end, string(i.data())));
@@ -590,6 +595,10 @@ LinkerObject const& Assembly::assemble() const
ret.linkReferences[ret.bytecode.size()] = m_libraries.at(i.data());
ret.bytecode.resize(ret.bytecode.size() + 20);
break;
+ case PushDeployTimeAddress:
+ ret.bytecode.push_back(byte(Instruction::PUSH20));
+ ret.bytecode.resize(ret.bytecode.size() + 20);
+ break;
case Tag:
assertThrow(i.data() != 0, AssemblyException, "Invalid tag position.");
assertThrow(i.splitForeignPushTag().first == size_t(-1), AssemblyException, "Foreign tag.");