Skip to content

Commit

Permalink
Fix get_stmtLoc for GobView syntactic/semantic search
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Feb 28, 2024
1 parent 52b042c commit c22c775
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transform/expressionEvaluation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct
(* Take all statements *)
|> List.concat_map (fun (f : Cil.fundec) -> f.sallstmts |> List.map (fun s -> f, s))
(* Add locations *)
|> List.map (fun (f, (s : Cil.stmt)) -> (Cilfacade.get_stmtLoc s, f, s))
|> 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. *)

Check warning

Code scanning / Semgrep OSS

use Cilfacade instead Warning

use Cilfacade instead
(* Filter artificial ones by impossible location *)
|> List.filter (fun ((l : Cil.location), _, _) -> l.line >= 0)
(* Create hash table *)
Expand Down Expand Up @@ -109,7 +109,7 @@ struct
fun (s : Cil.stmt) ->
succeeding_statement := Some s;
(* Evaluate at (directly before) a succeeding location *)
Some(self#try_ask (Cilfacade.get_stmtLoc s) expression)
Some(self#try_ask (Cil.get_stmtLoc s.skind) expression) (* nosemgrep: cilfacade *) (* Must use CIL's because syntactic search is in CIL. *)

Check warning

Code scanning / Semgrep OSS

use Cilfacade instead Warning

use Cilfacade instead
end
statement.succs
with Not_found -> None
Expand Down

0 comments on commit c22c775

Please sign in to comment.