@@ -400,14 +400,16 @@ def setup_trampoline_analysis(self, b: str) -> None:
400400 trampoline = cast ("ARMCfgTrampolineBlock" , self .cfgtc_blocks2 [b ])
401401 tpre = trampoline .prenodes
402402 tpost = trampoline .postnodes
403+ # Need this definition up here, otherwise mypy gets mad.
404+ roles : Dict [str , "BasicBlock" ] = {}
405+
403406 if len (tpre ) == 1 and len (tpost ) == 1 :
404407 if (
405408 tpre [0 ] in cfg2unmapped
406409 and tpost [0 ] in cfg2unmapped
407410 and tpre [0 ] in cfg1unmapped ):
408411 # Case where trampoline has an early return and a fallthrough case
409412 # (what we mark as the exit block)
410- roles : Dict [str , "BasicBlock" ] = {}
411413 roles ["entry" ] = self .basic_blocks2 [tpre [0 ]]
412414 roles ["exit" ] = self .basic_blocks2 [tpost [0 ]]
413415 for (role , addr ) in trampoline .roles .items ():
@@ -447,7 +449,6 @@ def setup_trampoline_analysis(self, b: str) -> None:
447449 fallthrough .baddr , fallthrough_post )
448450 return
449451
450- roles : Dict [str , "BasicBlock" ] = {}
451452 roles ["entry" ] = self .basic_blocks2 [tpre [0 ]]
452453 roles ["exit" ] = self .basic_blocks2 [fallthrough_post [0 ]]
453454 for (role , addr ) in trampoline .roles .items ():
0 commit comments