From 6887fbdc06e1953c487a5bdafe0ae80f999c3840 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Tue, 14 May 2019 10:41:52 +0200 Subject: [PATCH] move constraint creation out of try context --- mythril/analysis/modules/external_calls.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index 10f1eaa4..e24470a6 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -108,14 +108,15 @@ def _analyze_state(state): def _is_precompile_call(global_state: GlobalState): to = global_state.mstate.stack[-2] # type: BitVec + constraints = copy(global_state.mstate.constraints) + constraints += [ + Or( + to < symbol_factory.BitVecVal(1, 256), + to > symbol_factory.BitVecVal(16, 256), + ) + ] + try: - constraints = copy(global_state.mstate.constraints) - constraints += [ - Or( - to < symbol_factory.BitVecVal(1, 256), - to > symbol_factory.BitVecVal(16, 256), - ) - ] solver.get_model(constraints) return False except UnsatError: