Skip to content

Commit bd3aa68

Browse files
brksipma
authored andcommitted
Cfg.py: add zero-length instruction span for case labels
1 parent a2b32f8 commit bd3aa68

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

chb/app/Cfg.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,11 @@ def node_within(x: str, merges: List[str], ctx: ControlFlowContext) -> List[AST.
574574
for succ in succs:
575575
if jumptable.has_target(succ) and succ not in succlabels:
576576
cvs = jumptable.get_target(succ)
577-
labels = [cast(AST.ASTStmtLabel, astree.mk_case_label(
578-
astree.mk_integer_constant(c))) for c in cvs]
577+
def rawlabel(c):
578+
r = astree.mk_case_label(astree.mk_integer_constant(c))
579+
astree.add_instruction_span(r.locationid, succ, "")
580+
return r
581+
labels = [cast(AST.ASTStmtLabel, rawlabel(c)) for c in cvs]
579582
succlabels[succ] = labels
580583

581584
switchcondition = astlastinstr.ast_switch_condition(astree)

chb/bin/binaries/chx86_analyze

24.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)