-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Experimental mloadresolver #10681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental mloadresolver #10681
Conversation
542b096 to
e4c47aa
Compare
e4c47aa to
b698618
Compare
| case 0 { data := 96 } | ||
| default { | ||
| let result := and(add(returndatasize(), 63), not(31)) | ||
| let memPtr := mload(64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example from #10645. This mload(64) can be resolved.
| case evmasm::Instruction::EXTCODESIZE: | ||
| case evmasm::Instruction::MSIZE: | ||
| case evmasm::Instruction::RETURNDATASIZE: | ||
| return newRestrictedVariable(bigint(1) << 32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 1<<64 is safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, it's the EIP!
| { | ||
| // Avoiding wrapping | ||
| m_solver->push(); | ||
| m_solver->addAssertion(arguments.at(0) + arguments.at(1) >= (bigint(1) << 256)); | ||
| CheckResult result = m_solver->check({}).first; | ||
| m_solver->pop(); | ||
| if (result == CheckResult::UNSATISFIABLE) | ||
| return arguments.at(0) + arguments.at(1); | ||
| else | ||
| return newRestrictedVariable(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekpyron here is an example of relaxation.
|
Closing this to reduced PR count. The PR has enough information for future needs. |
No description provided.