diff options
author | chriseth <c@ethdev.com> | 2016-11-11 01:16:21 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:18 +0800 |
commit | e543bd34c0b4884b5a27555f698f50af6a1c0b81 (patch) | |
tree | ef2c12e4767a3d38603323212face114213ca4b4 /libsolidity/codegen/CompilerUtils.cpp | |
parent | ee3efa67a8d3eb4077786fd745c1925a916419f5 (diff) | |
download | dexon-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/codegen/CompilerUtils.cpp')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index dedb53e7..1e21c020 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -340,6 +340,19 @@ void CompilerUtils::combineExternalFunctionType(bool _leftAligned) m_context << Instruction::OR; } +void CompilerUtils::pushCombinedFunctionEntryLabel(Declaration const& _function) +{ + m_context << m_context.functionEntryLabel(_function).pushTag(); + // If there is a runtime context, we have to merge both labels into the same + // stack slot in case we store it in storage. + if (CompilerContext* rtc = m_context.runtimeContext()) + m_context << + (u256(1) << 32) << + Instruction::MUL << + rtc->functionEntryLabel(_function).toSubAssemblyTag(m_context.runtimeSub()) << + Instruction::OR; +} + void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetType, bool _cleanupNeeded) { // For a type extension, we need to remove all higher-order bits that we might have ignored in |