refactor propagation logic to be more generic

pull/1353/head
Joran Honig 5 years ago
parent 4ec4ef242f
commit 5e140d6f1e
  1. 14
      mythril/laser/ethereum/svm.py

@ -372,21 +372,13 @@ class LaserEVM:
# First execute the post hook for the transaction ending instruction # First execute the post hook for the transaction ending instruction
self._execute_post_hook(op_code, [end_signal.global_state]) self._execute_post_hook(op_code, [end_signal.global_state])
# TODO: Remove the following section from the svm # Propagate annotations
# ================================================================
# Propogate codecall based annotations
if return_global_state.get_current_instruction()["opcode"] in (
"DELEGATECALL",
"CALLCODE",
):
new_annotations = [ new_annotations = [
annotation annotation
for annotation in global_state.get_annotations( for annotation in global_state.annotations
MutationAnnotation if annotation.persist_over_calls
)
] ]
return_global_state.add_annotations(new_annotations) return_global_state.add_annotations(new_annotations)
# ================================================================
new_global_states = self._end_message_call( new_global_states = self._end_message_call(
copy(return_global_state), copy(return_global_state),

Loading…
Cancel
Save