Skip to content

Commit c22c775

Browse files
committed
Fix get_stmtLoc for GobView syntactic/semantic search
1 parent 52b042c commit c22c775

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/transform/expressionEvaluation.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct
6868
(* Take all statements *)
6969
|> List.concat_map (fun (f : Cil.fundec) -> f.sallstmts |> List.map (fun s -> f, s))
7070
(* Add locations *)
71-
|> List.map (fun (f, (s : Cil.stmt)) -> (Cilfacade.get_stmtLoc s, f, s))
71+
|> List.map (fun (f, (s : Cil.stmt)) -> (Cil.get_stmtLoc s.skind, f, s)) (* nosemgrep: cilfacade *) (* Must use CIL's because syntactic search is in CIL. *)
7272
(* Filter artificial ones by impossible location *)
7373
|> List.filter (fun ((l : Cil.location), _, _) -> l.line >= 0)
7474
(* Create hash table *)
@@ -109,7 +109,7 @@ struct
109109
fun (s : Cil.stmt) ->
110110
succeeding_statement := Some s;
111111
(* Evaluate at (directly before) a succeeding location *)
112-
Some(self#try_ask (Cilfacade.get_stmtLoc s) expression)
112+
Some(self#try_ask (Cil.get_stmtLoc s.skind) expression) (* nosemgrep: cilfacade *) (* Must use CIL's because syntactic search is in CIL. *)
113113
end
114114
statement.succs
115115
with Not_found -> None

0 commit comments

Comments
 (0)