From c44bb7e7efc87018b3b68414b2109732da1771be Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Thu, 18 Feb 2021 18:49:34 -0500 Subject: [PATCH] Replace raw throw with BOOST_THROW_EXCEPTION. --- liblangutil/SemVerHandler.cpp | 10 ++--- liblangutil/SemVerHandler.h | 2 +- .../codegen/ir/IRGeneratorForStatements.cpp | 10 ++--- test/Common.cpp | 6 +-- test/CommonSyntaxTest.cpp | 2 +- test/EVMHost.cpp | 4 +- test/TestCase.cpp | 2 +- test/TestCaseReader.cpp | 10 ++--- test/libsolidity/util/BytesUtils.cpp | 8 ++-- test/libsolidity/util/TestFileParser.cpp | 41 ++++++++++--------- test/tools/fuzzer_common.cpp | 4 +- .../EVMInstructionInterpreter.cpp | 12 +++--- .../EwasmBuiltinInterpreter.cpp | 22 +++++----- test/tools/yulInterpreter/Interpreter.cpp | 4 +- 14 files changed, 70 insertions(+), 67 deletions(-) diff --git a/liblangutil/SemVerHandler.cpp b/liblangutil/SemVerHandler.cpp index f2d9cb3d3..af408789c 100644 --- a/liblangutil/SemVerHandler.cpp +++ b/liblangutil/SemVerHandler.cpp @@ -43,7 +43,7 @@ SemVerVersion::SemVerVersion(string const& _versionString) if (level < 2) { if (i == end || *i != '.') - throw SemVerError(); + BOOST_THROW_EXCEPTION(SemVerError()); else ++i; } @@ -61,7 +61,7 @@ SemVerVersion::SemVerVersion(string const& _versionString) build = string(buildStart, i); } if (i != end) - throw SemVerError(); + BOOST_THROW_EXCEPTION(SemVerError()); } bool SemVerMatchExpression::MatchComponent::matches(SemVerVersion const& _version) const @@ -162,7 +162,7 @@ optional SemVerMatchExpressionParser::parse() if (m_pos >= m_tokens.size()) break; if (currentToken() != Token::Or) - throw SemVerError(); + BOOST_THROW_EXCEPTION(SemVerError()); nextToken(); } } @@ -256,14 +256,14 @@ unsigned SemVerMatchExpressionParser::parseVersionPart() { c = currentChar(); if (v * 10 < v || v * 10 + static_cast(c - '0') < v * 10) - throw SemVerError(); + BOOST_THROW_EXCEPTION(SemVerError()); v = v * 10 + static_cast(c - '0'); nextChar(); } return v; } else - throw SemVerError(); + BOOST_THROW_EXCEPTION(SemVerError()); } char SemVerMatchExpressionParser::currentChar() const diff --git a/liblangutil/SemVerHandler.h b/liblangutil/SemVerHandler.h index 9d5a55f98..0c4f57a03 100644 --- a/liblangutil/SemVerHandler.h +++ b/liblangutil/SemVerHandler.h @@ -34,7 +34,7 @@ namespace solidity::langutil { -class SemVerError: util::Exception +class SemVerError: public util::Exception { }; diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp index be8942f65..d616dfde8 100644 --- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp +++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp @@ -221,7 +221,7 @@ void IRGeneratorForStatements::generate(Block const& _block) { if (!boost::get_error_info(_error)) _error << langutil::errinfo_sourceLocation(m_currentLocation); - throw _error; + BOOST_THROW_EXCEPTION(_error); } } @@ -255,7 +255,7 @@ void IRGeneratorForStatements::initializeStateVar(VariableDeclaration const& _va { if (!boost::get_error_info(_error)) _error << langutil::errinfo_sourceLocation(m_currentLocation); - throw _error; + BOOST_THROW_EXCEPTION(_error); } } @@ -281,7 +281,7 @@ void IRGeneratorForStatements::initializeLocalVar(VariableDeclaration const& _va { if (!boost::get_error_info(_error)) _error << langutil::errinfo_sourceLocation(m_currentLocation); - throw _error; + BOOST_THROW_EXCEPTION(_error); } } @@ -300,7 +300,7 @@ IRVariable IRGeneratorForStatements::evaluateExpression(Expression const& _expre { if (!boost::get_error_info(_error)) _error << langutil::errinfo_sourceLocation(m_currentLocation); - throw _error; + BOOST_THROW_EXCEPTION(_error); } } @@ -333,7 +333,7 @@ string IRGeneratorForStatements::constantValueFunction(VariableDeclaration const { if (!boost::get_error_info(_error)) _error << langutil::errinfo_sourceLocation(m_currentLocation); - throw _error; + BOOST_THROW_EXCEPTION(_error); } } diff --git a/test/Common.cpp b/test/Common.cpp index 8c2be05ca..30d2f3d78 100644 --- a/test/Common.cpp +++ b/test/Common.cpp @@ -145,7 +145,7 @@ bool CommonOptions::parse(int argc, char const* const* argv) errorMessage << "Unrecognized option: "; for (auto const& token: parsedOption.original_tokens) errorMessage << token; - throw std::runtime_error(errorMessage.str()); + BOOST_THROW_EXCEPTION(std::runtime_error(errorMessage.str())); } if (vmPaths.empty()) @@ -185,7 +185,7 @@ langutil::EVMVersion CommonOptions::evmVersion() const { auto version = langutil::EVMVersion::fromString(evmVersionString); if (!version) - throw std::runtime_error("Invalid EVM version: " + evmVersionString); + BOOST_THROW_EXCEPTION(std::runtime_error("Invalid EVM version: " + evmVersionString)); return *version; } else @@ -196,7 +196,7 @@ langutil::EVMVersion CommonOptions::evmVersion() const CommonOptions const& CommonOptions::get() { if (!m_singleton) - throw std::runtime_error("Options not yet constructed!"); + BOOST_THROW_EXCEPTION(std::runtime_error("Options not yet constructed!")); return *m_singleton; } diff --git a/test/CommonSyntaxTest.cpp b/test/CommonSyntaxTest.cpp index 34ddf719e..1756e25af 100644 --- a/test/CommonSyntaxTest.cpp +++ b/test/CommonSyntaxTest.cpp @@ -44,7 +44,7 @@ namespace int parseUnsignedInteger(string::iterator& _it, string::iterator _end) { if (_it == _end || !isdigit(*_it)) - throw runtime_error("Invalid test expectation. Source location expected."); + BOOST_THROW_EXCEPTION(runtime_error("Invalid test expectation. Source location expected.")); int result = 0; while (_it != _end && isdigit(*_it)) { diff --git a/test/EVMHost.cpp b/test/EVMHost.cpp index c39540a75..6f1954334 100644 --- a/test/EVMHost.cpp +++ b/test/EVMHost.cpp @@ -80,14 +80,14 @@ bool EVMHost::checkVmPaths(vector const& _vmPaths) if (vm.has_capability(EVMC_CAPABILITY_EVM1)) { if (evmVmFound) - throw runtime_error("Multiple evm1 evmc vms defined. Please only define one evm1 evmc vm."); + BOOST_THROW_EXCEPTION(runtime_error("Multiple evm1 evmc vms defined. Please only define one evm1 evmc vm.")); evmVmFound = true; } if (vm.has_capability(EVMC_CAPABILITY_EWASM)) { if (ewasmVmFound) - throw runtime_error("Multiple ewasm evmc vms where defined. Please only define one ewasm evmc vm."); + BOOST_THROW_EXCEPTION(runtime_error("Multiple ewasm evmc vms where defined. Please only define one ewasm evmc vm.")); ewasmVmFound = true; } } diff --git a/test/TestCase.cpp b/test/TestCase.cpp index 7cf5c790e..93b209aba 100644 --- a/test/TestCase.cpp +++ b/test/TestCase.cpp @@ -65,7 +65,7 @@ bool TestCase::shouldRun() void TestCase::expect(string::iterator& _it, string::iterator _end, string::value_type _c) { if (_it == _end || *_it != _c) - throw runtime_error(string("Invalid test expectation. Expected: \"") + _c + "\"."); + BOOST_THROW_EXCEPTION(runtime_error(string("Invalid test expectation. Expected: \"") + _c + "\".")); ++_it; } diff --git a/test/TestCaseReader.cpp b/test/TestCaseReader.cpp index d38e883ea..2b1ba3606 100644 --- a/test/TestCaseReader.cpp +++ b/test/TestCaseReader.cpp @@ -95,10 +95,10 @@ string TestCaseReader::stringSetting(string const& _name, string const& _default void TestCaseReader::ensureAllSettingsRead() const { if (!m_unreadSettings.empty()) - throw runtime_error( + BOOST_THROW_EXCEPTION(runtime_error( "Unknown setting(s): " + util::joinHumanReadable(m_unreadSettings | boost::adaptors::map_keys) - ); + )); } pair TestCaseReader::parseSourcesAndSettingsWithLineNumber(istream& _stream) @@ -134,7 +134,7 @@ pair TestCaseReader::parseSourcesAndSettingsWithLineNumber(is line.size() - sourceDelimiterEnd.size() - sourceDelimiterStart.size() )); if (sources.count(currentSourceName)) - throw runtime_error("Multiple definitions of test source \"" + currentSourceName + "\"."); + BOOST_THROW_EXCEPTION(runtime_error("Multiple definitions of test source \"" + currentSourceName + "\".")); } else currentSource += line + "\n"; @@ -143,7 +143,7 @@ pair TestCaseReader::parseSourcesAndSettingsWithLineNumber(is { size_t colon = line.find(':'); if (colon == string::npos) - throw runtime_error(string("Expected \":\" inside setting.")); + BOOST_THROW_EXCEPTION(runtime_error(string("Expected \":\" inside setting."))); string key = line.substr(comment.size(), colon - comment.size()); string value = line.substr(colon + 1); boost::algorithm::trim(key); @@ -151,7 +151,7 @@ pair TestCaseReader::parseSourcesAndSettingsWithLineNumber(is m_settings[key] = value; } else - throw runtime_error(string("Expected \"//\" or \"// ---\" to terminate settings and source.")); + BOOST_THROW_EXCEPTION(runtime_error(string("Expected \"//\" or \"// ---\" to terminate settings and source."))); } // Register the last source as the main one sources[currentSourceName] = currentSource; diff --git a/test/libsolidity/util/BytesUtils.cpp b/test/libsolidity/util/BytesUtils.cpp index 23fa8684c..c3044d151 100644 --- a/test/libsolidity/util/BytesUtils.cpp +++ b/test/libsolidity/util/BytesUtils.cpp @@ -81,7 +81,7 @@ bytes BytesUtils::convertBoolean(string const& _literal) else if (_literal == "false") return bytes{false}; else - throw TestParserError("Boolean literal invalid."); + BOOST_THROW_EXCEPTION(TestParserError("Boolean literal invalid.")); } bytes BytesUtils::convertNumber(string const& _literal) @@ -92,7 +92,7 @@ bytes BytesUtils::convertNumber(string const& _literal) } catch (std::exception const&) { - throw TestParserError("Number encoding invalid."); + BOOST_THROW_EXCEPTION(TestParserError("Number encoding invalid.")); } } @@ -104,7 +104,7 @@ bytes BytesUtils::convertHexNumber(string const& _literal) } catch (std::exception const&) { - throw TestParserError("Hex number encoding invalid."); + BOOST_THROW_EXCEPTION(TestParserError("Hex number encoding invalid.")); } } @@ -116,7 +116,7 @@ bytes BytesUtils::convertString(string const& _literal) } catch (std::exception const&) { - throw TestParserError("String encoding invalid."); + BOOST_THROW_EXCEPTION(TestParserError("String encoding invalid.")); } } diff --git a/test/libsolidity/util/TestFileParser.cpp b/test/libsolidity/util/TestFileParser.cpp index 7654e384d..37f32ccee 100644 --- a/test/libsolidity/util/TestFileParser.cpp +++ b/test/libsolidity/util/TestFileParser.cpp @@ -96,7 +96,7 @@ vector TestFileParser::parseFunctionCall else if (m_scanner.currentLiteral() == "nonempty") call.expectations.result.back().rawBytes = bytes(1, uint8_t(true)); else - throw TestParserError("Expected \"empty\" or \"nonempty\"."); + BOOST_THROW_EXCEPTION(TestParserError("Expected \"empty\" or \"nonempty\".")); call.kind = FunctionCall::Kind::Storage; m_scanner.scanNextToken(); } @@ -150,7 +150,9 @@ vector TestFileParser::parseFunctionCall } catch (TestParserError const& _e) { - throw TestParserError("Line " + to_string(_lineOffset + m_lineNumber) + ": " + _e.what()); + BOOST_THROW_EXCEPTION( + TestParserError("Line " + to_string(_lineOffset + m_lineNumber) + ": " + _e.what()) + ); } } } @@ -170,11 +172,12 @@ bool TestFileParser::accept(Token _token, bool const _expect) bool TestFileParser::expect(Token _token, bool const _advance) { if (m_scanner.currentToken() != _token || m_scanner.currentToken() == Token::Invalid) - throw TestParserError( + BOOST_THROW_EXCEPTION(TestParserError( "Unexpected " + formatToken(m_scanner.currentToken()) + ": \"" + m_scanner.currentLiteral() + "\". " + "Expected \"" + formatToken(_token) + "\"." - ); + ) + ); if (_advance) m_scanner.scanNextToken(); return true; @@ -206,10 +209,10 @@ pair TestFileParser::parseFunctionSignature() parameters += parseIdentifierOrTuple(); } if (accept(Token::Arrow, true)) - throw TestParserError("Invalid signature detected: " + signature); + BOOST_THROW_EXCEPTION(TestParserError("Invalid signature detected: " + signature)); if (!hasName && !parameters.empty()) - throw TestParserError("Signatures without a name cannot have parameters: " + signature); + BOOST_THROW_EXCEPTION(TestParserError("Signatures without a name cannot have parameters: " + signature)); else signature += parameters; @@ -226,7 +229,7 @@ FunctionValue TestFileParser::parseFunctionCallValue() u256 value{ parseDecimalNumber() }; Token token = m_scanner.currentToken(); if (token != Token::Ether && token != Token::Wei) - throw TestParserError("Invalid value unit provided. Coins can be wei or ether."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid value unit provided. Coins can be wei or ether.")); m_scanner.scanNextToken(); @@ -235,7 +238,7 @@ FunctionValue TestFileParser::parseFunctionCallValue() } catch (std::exception const&) { - throw TestParserError("Ether value encoding invalid."); + BOOST_THROW_EXCEPTION(TestParserError("Ether value encoding invalid.")); } } @@ -245,7 +248,7 @@ FunctionCallArgs TestFileParser::parseFunctionCallArguments() auto param = parseParameter(); if (param.abiType.type == ABIType::None) - throw TestParserError("No argument provided."); + BOOST_THROW_EXCEPTION(TestParserError("No argument provided.")); arguments.parameters.emplace_back(param); while (accept(Token::Comma, true)) @@ -309,7 +312,7 @@ Parameter TestFileParser::parseParameter() if (accept(Token::Boolean)) { if (isSigned) - throw TestParserError("Invalid boolean literal."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid boolean literal.")); parameter.abiType = ABIType{ABIType::Boolean, ABIType::AlignRight, 32}; string parsed = parseBoolean(); @@ -323,7 +326,7 @@ Parameter TestFileParser::parseParameter() else if (accept(Token::HexNumber)) { if (isSigned) - throw TestParserError("Invalid hex number literal."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid hex number literal.")); parameter.abiType = ABIType{ABIType::Hex, ABIType::AlignRight, 32}; string parsed = parseHexNumber(); @@ -337,9 +340,9 @@ Parameter TestFileParser::parseParameter() else if (accept(Token::Hex, true)) { if (isSigned) - throw TestParserError("Invalid hex string literal."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid hex string literal.")); if (parameter.alignment != Parameter::Alignment::None) - throw TestParserError("Hex string literals cannot be aligned or padded."); + BOOST_THROW_EXCEPTION(TestParserError("Hex string literals cannot be aligned or padded.")); string parsed = parseString(); parameter.rawString += "hex\"" + parsed + "\""; @@ -351,9 +354,9 @@ Parameter TestFileParser::parseParameter() else if (accept(Token::String)) { if (isSigned) - throw TestParserError("Invalid string literal."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid string literal.")); if (parameter.alignment != Parameter::Alignment::None) - throw TestParserError("String literals cannot be aligned or padded."); + BOOST_THROW_EXCEPTION(TestParserError("String literals cannot be aligned or padded.")); string parsed = parseString(); parameter.abiType = ABIType{ABIType::String, ABIType::AlignLeft, parsed.size()}; @@ -383,7 +386,7 @@ Parameter TestFileParser::parseParameter() else if (accept(Token::Failure, true)) { if (isSigned) - throw TestParserError("Invalid failure literal."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid failure literal.")); parameter.abiType = ABIType{ABIType::Failure, ABIType::AlignRight, 0}; parameter.rawBytes = bytes{}; @@ -578,7 +581,7 @@ void TestFileParser::Scanner::scanNextToken() m_currentLiteral = ""; } else - throw TestParserError("Unexpected character: '" + string{current()} + "'"); + BOOST_THROW_EXCEPTION(TestParserError("Unexpected character: '" + string{current()} + "'")); break; } } @@ -670,7 +673,7 @@ string TestFileParser::Scanner::scanString() str += scanHexPart(); break; default: - throw TestParserError("Invalid or escape sequence found in string literal."); + BOOST_THROW_EXCEPTION(TestParserError("Invalid or escape sequence found in string literal.")); } } else @@ -693,7 +696,7 @@ char TestFileParser::Scanner::scanHexPart() else if (tolower(current()) >= 'a' && tolower(current()) <= 'f') value = tolower(current()) - 'a' + 10; else - throw TestParserError("\\x used with no following hex digits."); + BOOST_THROW_EXCEPTION(TestParserError("\\x used with no following hex digits.")); advance(); if (current() == '"') diff --git a/test/tools/fuzzer_common.cpp b/test/tools/fuzzer_common.cpp index 16342c1c9..d8e1b3b96 100644 --- a/test/tools/fuzzer_common.cpp +++ b/test/tools/fuzzer_common.cpp @@ -139,7 +139,7 @@ void FuzzerUtil::runCompiler(string const& _input, bool _quiet) { string msg{"Compiler produced invalid JSON output."}; cout << msg << endl; - throw std::runtime_error(std::move(msg)); + BOOST_THROW_EXCEPTION(std::runtime_error(std::move(msg))); } if (output.isMember("errors")) for (auto const& error: output["errors"]) @@ -152,7 +152,7 @@ void FuzzerUtil::runCompiler(string const& _input, bool _quiet) { string msg = "Invalid error: \"" + error["type"].asString() + "\""; cout << msg << endl; - throw std::runtime_error(std::move(msg)); + BOOST_THROW_EXCEPTION(std::runtime_error(std::move(msg))); } } } diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp index af3ae031b..3f3ede29b 100644 --- a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp +++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp @@ -95,7 +95,7 @@ u256 EVMInstructionInterpreter::eval( switch (_instruction) { case Instruction::STOP: - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); // --------------- arithmetic --------------- case Instruction::ADD: return arg[0] + arg[1]; @@ -328,18 +328,18 @@ u256 EVMInstructionInterpreter::eval( if (accessMemory(arg[0], arg[1])) data = readMemory(arg[0], arg[1]); logTrace(_instruction, arg, data); - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); } case Instruction::REVERT: accessMemory(arg[0], arg[1]); logTrace(_instruction, arg); - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); case Instruction::INVALID: logTrace(_instruction); - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); case Instruction::SELFDESTRUCT: logTrace(_instruction, arg); - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); case Instruction::POP: break; // --------------- invalid in strict assembly --------------- @@ -527,6 +527,6 @@ void EVMInstructionInterpreter::logTrace(std::string const& _pseudoInstruction, if (m_state.maxTraceSize > 0 && m_state.trace.size() >= m_state.maxTraceSize) { m_state.trace.emplace_back("Trace size limit reached."); - throw TraceLimitReached(); + BOOST_THROW_EXCEPTION(TraceLimitReached()); } } diff --git a/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp b/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp index b2fc827e4..84f16cd2a 100644 --- a/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp +++ b/test/tools/yulInterpreter/EwasmBuiltinInterpreter.cpp @@ -178,7 +178,7 @@ u256 EwasmBuiltinInterpreter::evalBuiltin( else if (fun == "unreachable") { logTrace(evmasm::Instruction::INVALID, {}); - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); } else if (fun == "i64.store") { @@ -258,14 +258,14 @@ u256 EwasmBuiltinInterpreter::evalWasmBuiltin(string const& _fun, vector c else if (_fun == "div_u") { if (arg[1] == 0) - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); else return arg[0] / arg[1]; } else if (_fun == "rem_u") { if (arg[1] == 0) - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); else return arg[0] % arg[1]; } @@ -337,7 +337,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector m_state.calldata.size()) - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); accessMemory(arg[0], arg[2]); copyZeroExtended( m_state.memory, m_state.calldata, @@ -446,7 +446,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector 4) - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); if (numberOfTopics > 0) readBytes32(arg[3]); if (numberOfTopics > 1) @@ -471,7 +471,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector m_state.returndata.size()) - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); accessMemory(arg[0], arg[2]); copyZeroExtended( m_state.memory, m_state.calldata, @@ -498,7 +498,7 @@ u256 EwasmBuiltinInterpreter::evalEthBuiltin(string const& _fun, vector m_state.msize)) // Ewasm throws out of bounds exception as opposed to the EVM. - throw ExplicitlyTerminated(); + BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); } bytes EwasmBuiltinInterpreter::readMemory(uint64_t _offset, uint64_t _size) @@ -604,6 +604,6 @@ void EwasmBuiltinInterpreter::logTrace(std::string const& _pseudoInstruction, st if (m_state.maxTraceSize > 0 && m_state.trace.size() >= m_state.maxTraceSize) { m_state.trace.emplace_back("Trace size limit reached."); - throw TraceLimitReached(); + BOOST_THROW_EXCEPTION(TraceLimitReached()); } } diff --git a/test/tools/yulInterpreter/Interpreter.cpp b/test/tools/yulInterpreter/Interpreter.cpp index df1aaaef3..be37076f2 100644 --- a/test/tools/yulInterpreter/Interpreter.cpp +++ b/test/tools/yulInterpreter/Interpreter.cpp @@ -241,7 +241,7 @@ void Interpreter::incrementStep() if (m_state.maxSteps > 0 && m_state.numSteps >= m_state.maxSteps) { m_state.trace.emplace_back("Interpreter execution step limit reached."); - throw StepLimitReached(); + BOOST_THROW_EXCEPTION(StepLimitReached()); } } @@ -351,6 +351,6 @@ void ExpressionEvaluator::incrementStep() if (m_state.maxExprNesting > 0 && m_nestingLevel > m_state.maxExprNesting) { m_state.trace.emplace_back("Maximum expression nesting level reached."); - throw ExpressionNestingLimitReached(); + BOOST_THROW_EXCEPTION(ExpressionNestingLimitReached()); } }