Added missing source locations for new memory management code.

This commit is contained in:
chriseth 2015-06-10 17:51:24 +02:00
parent e224a02826
commit c3caa2ce25

View File

@ -52,6 +52,8 @@ void Compiler::compileContract(ContractDefinition const& _contract,
map<ContractDefinition const*, bytes const*> const& _contracts) map<ContractDefinition const*, bytes const*> const& _contracts)
{ {
m_context = CompilerContext(); // clear it just in case m_context = CompilerContext(); // clear it just in case
{
CompilerContext::LocationSetter locationSetterRunTime(m_context, _contract);
CompilerUtils(m_context).initialiseFreeMemoryPointer(); CompilerUtils(m_context).initialiseFreeMemoryPointer();
initializeContext(_contract, _contracts); initializeContext(_contract, _contracts);
appendFunctionSelector(_contract); appendFunctionSelector(_contract);
@ -65,9 +67,11 @@ void Compiler::compileContract(ContractDefinition const& _contract,
} }
functions = m_context.getFunctionsWithoutCode(); functions = m_context.getFunctionsWithoutCode();
} }
}
// Swap the runtime context with the creation-time context // Swap the runtime context with the creation-time context
swap(m_context, m_runtimeContext); swap(m_context, m_runtimeContext);
CompilerContext::LocationSetter locationSetterCreationTime(m_context, _contract);
CompilerUtils(m_context).initialiseFreeMemoryPointer(); CompilerUtils(m_context).initialiseFreeMemoryPointer();
initializeContext(_contract, _contracts); initializeContext(_contract, _contracts);
packIntoContractCreator(_contract, m_runtimeContext); packIntoContractCreator(_contract, m_runtimeContext);