From dcee8e11adba5382d40a25b4e61b5b364d27ecb2 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 20 Jun 2018 16:59:35 +0200 Subject: Reorder some of the flow in CompilerStack::compileContract for readability --- libsolidity/interface/CompilerStack.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 47dc30cf..a3646a3d 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -711,9 +711,15 @@ void CompilerStack::compileContract( for (auto const* dependency: _contract.annotation().contractDependencies) compileContract(*dependency, _compiledContracts); - shared_ptr compiler = make_shared(m_evmVersion, m_optimize, m_optimizeRuns); Contract& compiledContract = m_contracts.at(_contract.fullyQualifiedName()); + + shared_ptr compiler = make_shared(m_evmVersion, m_optimize, m_optimizeRuns); + compiledContract.compiler = compiler; + string metadata = createMetadata(compiledContract); + compiledContract.metadata = metadata; + + // Prepare CBOR metadata for the bytecode bytes cborEncodedHash = // CBOR-encoding of the key "bzzr0" bytes{0x65, 'b', 'z', 'z', 'r', '0'}+ @@ -734,8 +740,9 @@ void CompilerStack::compileContract( solAssert(cborEncodedMetadata.size() <= 0xffff, "Metadata too large"); // 16-bit big endian length cborEncodedMetadata += toCompactBigEndian(cborEncodedMetadata.size(), 2); + + // Run optimiser and compile the contract. compiler->compileContract(_contract, _compiledContracts, cborEncodedMetadata); - compiledContract.compiler = compiler; try { @@ -763,7 +770,6 @@ void CompilerStack::compileContract( solAssert(false, "Assembly exception for deployed bytecode"); } - compiledContract.metadata = metadata; _compiledContracts[compiledContract.contract] = &compiler->assembly(); try -- cgit v1.2.3 From 0a632011be455d108eebc8a338346cfa2d40e527 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 20 Jun 2018 17:04:22 +0200 Subject: CompilerStack absolutePath/sanitizePath can be made static --- libsolidity/interface/CompilerStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index a3646a3d..a8668336 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -669,7 +669,7 @@ void CompilerStack::resolveImports() swap(m_sourceOrder, sourceOrder); } -string CompilerStack::absolutePath(string const& _path, string const& _reference) const +string CompilerStack::absolutePath(string const& _path, string const& _reference) { using path = boost::filesystem::path; path p(_path); -- cgit v1.2.3 From a392e0f0469c711aed5e21b28781de25424d5ab7 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 20 Jun 2018 23:19:06 +0200 Subject: Properly catch optimizer/assembly exception in CompilerStack --- libsolidity/interface/CompilerStack.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') 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"); -- cgit v1.2.3 From 3fc7da11db2b03e63a66e22b72df2d18e534c4e9 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 22 Jun 2018 12:02:50 +0200 Subject: Pull out createCBORMetadata helper --- libsolidity/interface/CompilerStack.cpp | 50 +++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 4e8d1461..aa33bad8 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -719,27 +719,10 @@ void CompilerStack::compileContract( string metadata = createMetadata(compiledContract); compiledContract.metadata = metadata; - // Prepare CBOR metadata for the bytecode - bytes cborEncodedHash = - // CBOR-encoding of the key "bzzr0" - bytes{0x65, 'b', 'z', 'z', 'r', '0'}+ - // CBOR-encoding of the hash - bytes{0x58, 0x20} + dev::swarmHash(metadata).asBytes(); - bytes cborEncodedMetadata; - if (onlySafeExperimentalFeaturesActivated(_contract.sourceUnit().annotation().experimentalFeatures)) - cborEncodedMetadata = - // CBOR-encoding of {"bzzr0": dev::swarmHash(metadata)} - bytes{0xa1} + - cborEncodedHash; - else - cborEncodedMetadata = - // CBOR-encoding of {"bzzr0": dev::swarmHash(metadata), "experimental": true} - bytes{0xa2} + - cborEncodedHash + - bytes{0x6c, 'e', 'x', 'p', 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l', 0xf5}; - solAssert(cborEncodedMetadata.size() <= 0xffff, "Metadata too large"); - // 16-bit big endian length - cborEncodedMetadata += toCompactBigEndian(cborEncodedMetadata.size(), 2); + bytes cborEncodedMetadata = createCBORMetadata( + metadata, + !onlySafeExperimentalFeaturesActivated(_contract.sourceUnit().annotation().experimentalFeatures) + ); try { @@ -901,6 +884,31 @@ string CompilerStack::createMetadata(Contract const& _contract) const return jsonCompactPrint(meta); } +bytes CompilerStack::createCBORMetadata(string _metadata, bool _experimentalMode) +{ + bytes cborEncodedHash = + // CBOR-encoding of the key "bzzr0" + bytes{0x65, 'b', 'z', 'z', 'r', '0'}+ + // CBOR-encoding of the hash + bytes{0x58, 0x20} + dev::swarmHash(_metadata).asBytes(); + bytes cborEncodedMetadata; + if (_experimentalMode) + cborEncodedMetadata = + // CBOR-encoding of {"bzzr0": dev::swarmHash(metadata), "experimental": true} + bytes{0xa2} + + cborEncodedHash + + bytes{0x6c, 'e', 'x', 'p', 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l', 0xf5}; + else + cborEncodedMetadata = + // CBOR-encoding of {"bzzr0": dev::swarmHash(metadata)} + bytes{0xa1} + + cborEncodedHash; + solAssert(cborEncodedMetadata.size() <= 0xffff, "Metadata too large"); + // 16-bit big endian length + cborEncodedMetadata += toCompactBigEndian(cborEncodedMetadata.size(), 2); + return cborEncodedMetadata; +} + string CompilerStack::computeSourceMapping(eth::AssemblyItems const& _items) const { string ret; -- cgit v1.2.3 From f74cff622dd0eb8d4e64c014731e00fb9ea1d078 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 19 Jun 2018 19:30:38 +0200 Subject: Properly explain all the analsys steps in CompilerStack --- libsolidity/interface/CompilerStack.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index aa33bad8..32cb488f 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -191,6 +191,8 @@ bool CompilerStack::analyze() if (!resolver.performImports(*source->ast, sourceUnitsByName)) return false; + // This is the main name and type resolution loop. Needs to be run for every contract, because + // the special variables "this" and "super" must be set appropriately. for (Source const* source: m_sourceOrder) for (ASTPointer const& node: source->ast->nodes()) if (ContractDefinition* contract = dynamic_cast(node.get())) @@ -204,11 +206,15 @@ bool CompilerStack::analyze() // thus contracts can only conflict if declared in the same source file. This // already causes a double-declaration error elsewhere, so we do not report // an error here and instead silently drop any additional contracts we find. - if (m_contracts.find(contract->fullyQualifiedName()) == m_contracts.end()) m_contracts[contract->fullyQualifiedName()].contract = contract; } + // This cannot be done in the above loop, because cross-contract types couldn't be resolved. + // A good example is `LibraryName.TypeName x;`. + // + // Note: this does not resolve overloaded functions. In order to do that, types of arguments are needed, + // which is only done one step later. TypeChecker typeChecker(m_evmVersion, m_errorReporter); for (Source const* source: m_sourceOrder) for (ASTPointer const& node: source->ast->nodes()) @@ -218,6 +224,7 @@ bool CompilerStack::analyze() if (noErrors) { + // Checks that can only be done when all types of all AST nodes are known. PostTypeChecker postTypeChecker(m_errorReporter); for (Source const* source: m_sourceOrder) if (!postTypeChecker.check(*source->ast)) @@ -226,6 +233,8 @@ bool CompilerStack::analyze() if (noErrors) { + // Control flow graph generator and analyzer. It can check for issues such as + // variable is used before it is assigned to. CFG cfg(m_errorReporter); for (Source const* source: m_sourceOrder) if (!cfg.constructFlow(*source->ast)) @@ -242,6 +251,7 @@ bool CompilerStack::analyze() if (noErrors) { + // Checks for common mistakes. Only generates warnings. StaticAnalyzer staticAnalyzer(m_errorReporter); for (Source const* source: m_sourceOrder) if (!staticAnalyzer.analyze(*source->ast)) @@ -250,6 +260,7 @@ bool CompilerStack::analyze() if (noErrors) { + // Check for state mutability in every function. vector> ast; for (Source const* source: m_sourceOrder) ast.push_back(source->ast); @@ -300,6 +311,7 @@ bool CompilerStack::compile() if (!parseAndAnalyze()) return false; + // Only compile contracts individually which have been requested. map compiledContracts; for (Source const* source: m_sourceOrder) for (ASTPointer const& node: source->ast->nodes()) -- cgit v1.2.3 From 3de0b8b7f002bdc76e629f89df73523b36a169f5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 27 Jun 2018 18:08:49 +0200 Subject: Move absolutePath/sanitizePath helpers from CompilerStack to libdevcore --- libsolidity/interface/CompilerStack.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 32cb488f..0f19b7fd 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -583,7 +583,7 @@ StringMap CompilerStack::loadMissingSources(SourceUnit const& _ast, std::string for (auto const& node: _ast.nodes()) if (ImportDirective const* import = dynamic_cast(node.get())) { - string importPath = absolutePath(import->path(), _sourcePath); + string importPath = dev::absolutePath(import->path(), _sourcePath); // The current value of `path` is the absolute path as seen from this source file. // We first have to apply remappings before we can store the actual absolute path // as seen globally. @@ -626,8 +626,8 @@ string CompilerStack::applyRemapping(string const& _path, string const& _context for (auto const& redir: m_remappings) { - string context = sanitizePath(redir.context); - string prefix = sanitizePath(redir.prefix); + string context = dev::sanitizePath(redir.context); + string prefix = dev::sanitizePath(redir.prefix); // Skip if current context is closer if (context.length() < longestContext) @@ -644,7 +644,7 @@ string CompilerStack::applyRemapping(string const& _path, string const& _context longestContext = context.length(); longestPrefix = prefix.length(); - bestMatchTarget = sanitizePath(redir.target); + bestMatchTarget = dev::sanitizePath(redir.target); } string path = bestMatchTarget; path.append(_path.begin() + longestPrefix, _path.end()); @@ -681,23 +681,6 @@ void CompilerStack::resolveImports() swap(m_sourceOrder, sourceOrder); } -string CompilerStack::absolutePath(string const& _path, string const& _reference) -{ - using path = boost::filesystem::path; - path p(_path); - // Anything that does not start with `.` is an absolute path. - if (p.begin() == p.end() || (*p.begin() != "." && *p.begin() != "..")) - return _path; - path result(_reference); - result.remove_filename(); - for (path::iterator it = p.begin(); it != p.end(); ++it) - if (*it == "..") - result = result.parent_path(); - else if (*it != ".") - result /= *it; - return result.generic_string(); -} - namespace { bool onlySafeExperimentalFeaturesActivated(set const& features) -- cgit v1.2.3 From 71e26f6adb7d6b28400a6607570bb1e17da24feb Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 6 Aug 2018 18:32:18 +0200 Subject: Remove clone feature. --- libsolidity/interface/CompilerStack.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 32cb488f..29f9ce7d 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -329,7 +329,6 @@ void CompilerStack::link() { contract.second.object.link(m_libraries); contract.second.runtimeObject.link(m_libraries); - contract.second.cloneObject.link(m_libraries); } } @@ -408,11 +407,6 @@ eth::LinkerObject const& CompilerStack::runtimeObject(string const& _contractNam return contract(_contractName).runtimeObject; } -eth::LinkerObject const& CompilerStack::cloneObject(string const& _contractName) const -{ - return contract(_contractName).cloneObject; -} - /// FIXME: cache this string string CompilerStack::assemblyString(string const& _contractName, StringMap _sourceCodes) const { @@ -767,23 +761,6 @@ void CompilerStack::compileContract( } _compiledContracts[compiledContract.contract] = &compiler->assembly(); - - try - { - if (!_contract.isLibrary()) - { - Compiler cloneCompiler(m_evmVersion, m_optimize, m_optimizeRuns); - cloneCompiler.compileClone(_contract, _compiledContracts); - compiledContract.cloneObject = cloneCompiler.assembledObject(); - } - } - catch (eth::AssemblyException const&) - { - // In some cases (if the constructor requests a runtime function), it is not - // possible to compile the clone. - - // TODO: Report error / warning - } } string const CompilerStack::lastContractName() const -- cgit v1.2.3 From e902ce1aa02dc5d19cc9dd231fa538646884826d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Aereal=20Ae=C3=B3n?= Date: Wed, 8 Aug 2018 11:26:30 -0300 Subject: Removing std:: from std::to_string and include for boost/lexical_cast --- libsolidity/interface/CompilerStack.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 32cb488f..a7a3fe7a 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -965,17 +965,17 @@ string CompilerStack::computeSourceMapping(eth::AssemblyItems const& _items) con if (components-- > 0) { if (location.start != prevStart) - ret += std::to_string(location.start); + ret += to_string(location.start); if (components-- > 0) { ret += ':'; if (length != prevLength) - ret += std::to_string(length); + ret += to_string(length); if (components-- > 0) { ret += ':'; if (sourceIndex != prevSourceIndex) - ret += std::to_string(sourceIndex); + ret += to_string(sourceIndex); if (components-- > 0) { ret += ':'; -- cgit v1.2.3 From 954d7433bd8c10bce917326f70070077f0cfc165 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 9 Aug 2018 20:37:49 +0200 Subject: Disallow remappings with empty prefix. --- libsolidity/interface/CompilerStack.cpp | 37 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 836e30d2..e800b278 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -58,22 +58,31 @@ using namespace std; using namespace dev; using namespace dev::solidity; -void CompilerStack::setRemappings(vector const& _remappings) +boost::optional CompilerStack::parseRemapping(string const& _remapping) +{ + auto eq = find(_remapping.begin(), _remapping.end(), '='); + if (eq == _remapping.end()) + return {}; + + auto colon = find(_remapping.begin(), eq, ':'); + + Remapping r; + + r.context = colon == eq ? string() : string(_remapping.begin(), colon); + r.prefix = colon == eq ? string(_remapping.begin(), eq) : string(colon + 1, eq); + r.target = string(eq + 1, _remapping.end()); + + if (r.prefix.empty()) + return {}; + + return r; +} + +void CompilerStack::setRemappings(vector const& _remappings) { - vector remappings; for (auto const& remapping: _remappings) - { - auto eq = find(remapping.begin(), remapping.end(), '='); - if (eq == remapping.end()) - continue; // ignore - auto colon = find(remapping.begin(), eq, ':'); - Remapping r; - r.context = colon == eq ? string() : string(remapping.begin(), colon); - r.prefix = colon == eq ? string(remapping.begin(), eq) : string(colon + 1, eq); - r.target = string(eq + 1, remapping.end()); - remappings.push_back(r); - } - swap(m_remappings, remappings); + solAssert(!remapping.prefix.empty(), ""); + m_remappings = _remappings; } void CompilerStack::setEVMVersion(EVMVersion _version) -- cgit v1.2.3 From 808c3f3df58d32c5d6056ece7da23db41d617c2b Mon Sep 17 00:00:00 2001 From: liangdzou Date: Mon, 17 Sep 2018 22:13:21 +0800 Subject: fix some format typos --- libsolidity/interface/CompilerStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index e800b278..adf59a9c 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -128,7 +128,7 @@ bool CompilerStack::addSource(string const& _name, string const& _content, bool bool CompilerStack::parse() { //reset - if(m_stackState != SourcesSet) + if (m_stackState != SourcesSet) return false; m_errorReporter.clear(); ASTNode::resetID(); -- cgit v1.2.3 From d71cc66ddeb3f6e91628c019966b5ea107df4a15 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 19 Sep 2018 12:57:50 +0100 Subject: Use GasEstimator::dataGas in CompilerStack --- libsolidity/interface/CompilerStack.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index adf59a9c..d1001c80 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -988,8 +988,7 @@ Json::Value CompilerStack::gasEstimates(string const& _contractName) const if (eth::AssemblyItems const* items = assemblyItems(_contractName)) { Gas executionGas = gasEstimator.functionalEstimation(*items); - u256 bytecodeSize(runtimeObject(_contractName).bytecode.size()); - Gas codeDepositGas = bytecodeSize * eth::GasCosts::createDataGas; + Gas codeDepositGas{eth::GasMeter::dataGas(runtimeObject(_contractName).bytecode, false)}; Json::Value creation(Json::objectValue); creation["codeDepositCost"] = gasToJson(codeDepositGas); -- cgit v1.2.3 From e732c49c2f6e1096cb9c20df7ec6c4db77f3a710 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 9 Oct 2018 18:06:25 +0100 Subject: Change find to use a single character --- libsolidity/interface/CompilerStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index d1001c80..1f58245f 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -780,7 +780,7 @@ CompilerStack::Contract const& CompilerStack::contract(string const& _contractNa // To provide a measure of backward-compatibility, if a contract is not located by its // fully-qualified name, a lookup will be attempted purely on the contract's name to see // if anything will satisfy. - if (_contractName.find(":") == string::npos) + if (_contractName.find(':') == string::npos) { for (auto const& contractEntry: m_contracts) { -- cgit v1.2.3 From 0f2ba3522fb01713a417d7b66c6c586359d6d130 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 9 Nov 2018 00:21:37 +0100 Subject: Reset yul string repository. --- libsolidity/interface/CompilerStack.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 1f58245f..e0909eb3 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -47,6 +47,8 @@ #include +#include + #include #include @@ -104,6 +106,7 @@ void CompilerStack::reset(bool _keepSources) m_stackState = Empty; m_sources.clear(); } + yul::YulStringRepository::instance().reset(); m_libraries.clear(); m_evmVersion = EVMVersion(); m_optimize = false; -- cgit v1.2.3 From 74557ceb0e520838d3e3a580cc30671a9c274ca7 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 9 Nov 2018 20:21:26 +0100 Subject: Deterministic YulStringRepository using string hashes. --- libsolidity/interface/CompilerStack.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index e0909eb3..7aa0faa7 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -106,7 +106,6 @@ void CompilerStack::reset(bool _keepSources) m_stackState = Empty; m_sources.clear(); } - yul::YulStringRepository::instance().reset(); m_libraries.clear(); m_evmVersion = EVMVersion(); m_optimize = false; -- cgit v1.2.3 From 9a4fd946c349712cab2c9f77f4dc08fb6e2ca68f Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 12 Nov 2018 12:21:25 +0100 Subject: Add Scanner function that prints source based on SourceLocation --- libsolidity/interface/CompilerStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/interface/CompilerStack.cpp') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 7aa0faa7..441c7897 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -284,7 +284,7 @@ bool CompilerStack::analyze() { SMTChecker smtChecker(m_errorReporter, m_smtQuery); for (Source const* source: m_sourceOrder) - smtChecker.analyze(*source->ast); + smtChecker.analyze(*source->ast, source->scanner); } } catch(FatalError const&) -- cgit v1.2.3