Skip to content

Commit 0ed7711

Browse files
committed
Extend comments about registerLabelsVisitor not touching currentExpLoc
1 parent 5f099de commit 0ed7711

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/frontc/cabs2cil.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ class registerLabelsVisitor = object
11741174

11751175
method! vstmt s =
11761176
currentLoc := convLoc (C.get_statementloc s);
1177-
(* don't touch currentExpLoc! *)
1177+
(* Don't touch currentExpLoc! Not used for registering labels and not reset after this visitor in doDecl. *)
11781178
(match s with
11791179
| A.LABEL (lbl,_,_) ->
11801180
AL.registerAlphaName ~alphaTable:alphaTable ~undolist:None ~lookupname:(kindPlusName "label" lbl) ~data:!currentLoc
@@ -5931,7 +5931,7 @@ and doDecl (isglobal: bool) : A.definition -> chunk = function
59315931
(* Enter all the function's labels into the alpha conversion table *)
59325932
ignore (V.visitCabsBlock (new registerLabelsVisitor) body);
59335933
currentLoc := funloc; (* registerLabelsVisitor changes currentLoc, so reset it *)
5934-
(* visitor doesn't touch currentExpLoc *)
5934+
(* Visitor doesn't use and touch currentExpLoc, so no need to reset. *)
59355935

59365936
(* Do not process transparent unions in function definitions.
59375937
* We'll do it later *)

0 commit comments

Comments
 (0)