Skip to main content

peel_int_casts

Function peel_int_casts 

Source
fn peel_int_casts<'a, 'hir>(expr: &'a Expr<'hir>) -> &'a Expr<'hir>
Expand description

Looks through parentheses and integer casts (uint256(x), int8(x)), returning the innermost operand. A misplaced ^ can hide behind such a cast (uint256(10) ^ 18), which a bare literal check would miss. Non-integer casts (bytes32(x), address(x)) are left alone, since xor of a bytesN bit pattern is a legitimate operation.