Skip to content

Conversation

@hrkrshnn
Copy link
Contributor

No description provided.

@hrkrshnn hrkrshnn force-pushed the experimental-mloadresolver branch from 542b096 to e4c47aa Compare December 22, 2020 11:19
@hrkrshnn hrkrshnn force-pushed the experimental-mloadresolver branch from e4c47aa to b698618 Compare December 22, 2020 11:40
case 0 { data := 96 }
default {
let result := and(add(returndatasize(), 63), not(31))
let memPtr := mload(64)
Copy link
Contributor Author

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);
Copy link
Contributor

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.

Copy link
Contributor

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!

Comment on lines +527 to +537
{
// 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();
}
Copy link
Contributor Author

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.

@hrkrshnn
Copy link
Contributor Author

hrkrshnn commented Feb 3, 2021

Closing this to reduced PR count. The PR has enough information for future needs.

@hrkrshnn hrkrshnn closed this Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants