Open
Description
Description
Hi! I tried to compile the following Solidity code using solc-latest --optimize --yul-optimizations 'xajs' --bin out.sol
, enabling the custom optimization sequence xajs
. solc threw an Invalid assembly/yul code
exception.
contract Test {
function g() private returns(bool) {
assembly {
for {
let x := 1
let y := 1
}
iszero(eq(x, 10))
{
x := add(x, y)
}
{ x := add(x, 1) }
}
return true;
}
function f() public returns(bool) {
return g();
}
}
Output:
Uncaught exception:
/solidity/libyul/AsmAnalysis.cpp(111): Throw in function static solidity::yul::AsmAnalysisInfo solidity::yul::AsmAnalyzer::analyzeStrictAssertCorrect(const solidity::yul::Dialect&, const solidity::yul::Block&, solidity::yul::Object::Structure)
Dynamic exception type: boost::wrapexcept<solidity::yul::YulAssertion>
std::exception::what: Invalid assembly/yul code.
[solidity::util::tag_comment*] = Invalid assembly/yul code.
Environment
- Compiler version:
solc-0.8.25+