angr/claripy

Replace `__pos__` op with `lambda x: x`

Closed this issue · 2 comments

Description

Here we define the __pos__ op:

BV.__pos__ = operations.op('__pos__', (BV,), BV, calc_length=operations.basic_length_calc)

This op is really just a no-op; that is to say x == +x should always be true; thus instead of creating an op for __pos__, why do we not just replace this function with lambda x: x?

Alternatives

Leave the function as is or add a simplifier.

Additional context

It adds code bloat and wastes cycles

Fixed via 306