Add function documentation

pull/112/head
Joran Honig 7 years ago
parent 398677a557
commit aa5db8ba3b
  1. 10
      mythril/analysis/modules/integer.py

@ -38,7 +38,12 @@ def execute(statespace):
def _check_integer_overflow(state, node):
"""Checks if an overflow occurs"""
"""
Checks for integer overflow
:param state: state from node to examine
:param node: node to examine
:return: found issue
"""
issues = []
# Check the instruction
@ -48,8 +53,11 @@ def _check_integer_overflow(state, node):
constraints = copy.deepcopy(node.constraints)
# Formulate overflow constraints
stack = state.mstate.stack
op0, op1 = stack[-1], stack[-2]
# An integer overflow is possible if op0 + op1,
constraints.append(UGT(op0 + op1, (2 ** 32) - 1))
try:

Loading…
Cancel
Save