move-language / move

Apache License 2.0
2.24k stars 677 forks source link

[verifier] fix unchecked overflow in stack usage verifier #1028

Closed fEst1ck closed 7 months ago

fEst1ck commented 1 year ago

Motivation

When verifying stack usage for basic blocks, if the overall_push overflows, and max_push_size is set in the verifier configuration, this should result in a VALUE_STACK_PUSH_OVERFLOW error. But the verifier will let it pass currently. (This condition is satisfiable when usize is 64bit, but not when usize is 32bit).

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

All bytecode-verifier-tests passed.