diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 57196eab..9755fc33 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -448,7 +448,11 @@ class LaserEVM: environment = state.environment disassembly = environment.code - if address in disassembly.address_to_function_name: + if isinstance( + state.world_state.transaction_sequence[-1], ContractCreationTransaction + ): + environment.active_function_name = "constructor" + elif address in disassembly.address_to_function_name: # Enter a new function environment.active_function_name = disassembly.address_to_function_name[ address diff --git a/mythril/laser/ethereum/transaction/concolic.py b/mythril/laser/ethereum/transaction/concolic.py index d8c251dd..164df8db 100644 --- a/mythril/laser/ethereum/transaction/concolic.py +++ b/mythril/laser/ethereum/transaction/concolic.py @@ -88,7 +88,7 @@ def _setup_global_state_for_execution(laser_evm, transaction) -> None: condition=None, ) ) - + global_state.world_state.transaction_sequence.append(transaction) global_state.node = new_node new_node.states.append(global_state) laser_evm.work_list.append(global_state)