|
|
|
@ -217,9 +217,8 @@ class Instruction: |
|
|
|
|
@instruction |
|
|
|
|
def exp_(self, global_state): |
|
|
|
|
state = global_state.mstate |
|
|
|
|
# we only implement 2 ** x |
|
|
|
|
base, exponent = util.pop_bitvec(state), util.pop_bitvec(state) |
|
|
|
|
|
|
|
|
|
base, exponent = util.pop_bitvec(state), util.pop_bitvec(state) |
|
|
|
|
if (type(base) != BitVecNumRef) or (type(exponent) != BitVecNumRef): |
|
|
|
|
state.stack.append(BitVec("(" + str(simplify(base)) + ")^(" + str(simplify(exponent)) + ")", 256)) |
|
|
|
|
elif base.as_long() == 2: |
|
|
|
@ -228,7 +227,8 @@ class Instruction: |
|
|
|
|
else: |
|
|
|
|
state.stack.append(base << (exponent - 1)) |
|
|
|
|
else: |
|
|
|
|
state.stack.append(base) |
|
|
|
|
state.stack.append(base.as_long() ** exponent.as_long()) |
|
|
|
|
|
|
|
|
|
return [global_state] |
|
|
|
|
|
|
|
|
|
@instruction |
|
|
|
|