@@ -90,14 +90,29 @@ def xtgt(self) -> "XXpr":
9090 index = 1 if self .is_unconditional else 4
9191 return self .xpr (index , "xtgt" )
9292
93+ @property
94+ def is_xtgt_known (self ) -> bool :
95+ index = 1 if self .is_unconditional else 4
96+ return self .xdata .xprs_r [index ] is not None
97+
9398 @property
9499 def annotation (self ) -> str :
95- if self ._xdata .has_branch_conditions ():
96- return "if " + str (self .tcond ) + " then goto " + str (self .xtgt )
97- elif self .is_unconditional :
98- return "goto " + str (self .xtgt )
100+ if self .is_ok :
101+ if self ._xdata .has_branch_conditions ():
102+ return "if " + str (self .tcond ) + " then goto " + str (self .xtgt )
103+ elif self .is_unconditional :
104+ return "goto " + str (self .xtgt )
105+ else :
106+ return "?"
107+ elif self .is_xtgt_known :
108+ if self ._xdata .has_branch_conditions ():
109+ return "if " + str (self .txpr ) + " then goto " + str (self .xtgt )
110+ elif self .is_unconditional :
111+ return "goto " + str (self .xtgt )
112+ else :
113+ return "?"
99114 else :
100- return "? "
115+ return "Error value "
101116
102117
103118@armregistry .register_tag ("B" , ARMOpcode )
@@ -151,7 +166,10 @@ def ft_conditions_basic(self, xdata: InstrXData) -> Sequence[XXpr]:
151166 def ft_conditions (self , xdata : InstrXData ) -> Sequence [XXpr ]:
152167 xd = ARMBranchXData (xdata )
153168 if xdata .has_branch_conditions ():
154- return [xd .fcond , xd .tcond ]
169+ if xd .is_ok :
170+ return [xd .fcond , xd .tcond ]
171+ else :
172+ return [xd .fxpr , xd .txpr ]
155173 else :
156174 return []
157175
@@ -191,7 +209,7 @@ def annotation(self, xdata: InstrXData) -> str:
191209 else :
192210 return xd .annotation
193211 else :
194- return "Error value"
212+ return xd . annotation
195213
196214 def target_expr_ast (
197215 self ,
@@ -264,6 +282,8 @@ def default(condition: XXpr) -> AST.ASTExpr:
264282 # case there are no rewritten variables, but this still has to be
265283 # validated with more instances.
266284
285+ xd = ARMBranchXData (xdata )
286+
267287 ftconds_basic = self .ft_conditions (xdata )
268288 ftconds = self .ft_conditions (xdata )
269289
0 commit comments