Skip to content

Commit

Permalink
CompilerStack: Don't swallow details include in OptimizerException
Browse files Browse the repository at this point in the history
- By catching and asserting it we hide the line number and message.
- OptimizerException inherits from util::Exception so just letting it through will have the same effect as asserting.
  • Loading branch information
cameel committed Feb 19, 2024
1 parent 6c5026d commit 18cabee
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,15 +1480,8 @@ void CompilerStack::compileContract(
solAssert(!m_viaIR, "");
bytes cborEncodedMetadata = createCBORMetadata(compiledContract, /* _forIR */ false);

try
{
// Run optimiser and compile the contract.
compiler->compileContract(_contract, _otherCompilers, cborEncodedMetadata);
}
catch(evmasm::OptimizerException const&)
{
solAssert(false, "Optimizer exception during compilation");
}
// Run optimiser and compile the contract.
compiler->compileContract(_contract, _otherCompilers, cborEncodedMetadata);

_otherCompilers[compiledContract.contract] = compiler;

Expand Down

0 comments on commit 18cabee

Please sign in to comment.