-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Open
Labels
bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.There is not much implementation work to be done. The task is very easy or tiny.medium impactDefault level of impactDefault level of impactmust haveSomething we consider an essential part of Solidity 1.0.Something we consider an essential part of Solidity 1.0.optimizer
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+
Saw-mon-and-Natalie
Metadata
Metadata
Assignees
Labels
bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.There is not much implementation work to be done. The task is very easy or tiny.medium impactDefault level of impactDefault level of impactmust haveSomething we consider an essential part of Solidity 1.0.Something we consider an essential part of Solidity 1.0.optimizer