Skip to content

Commit

Permalink
Fix ReachableFrom precision loss with int argument in 68-longjmp/41-p…
Browse files Browse the repository at this point in the history
…oison-rec
  • Loading branch information
sim642 committed Sep 19, 2023
1 parent c458db2 commit 204594e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,12 @@ struct
AD.add UnknownPtr addrs' (* add unknown back *)
else
addrs'
| Int i -> AD.of_int i
| Int i ->
begin match Cilfacade.typeOf e with
| t when Cil.isPointerType t -> AD.of_int i (* integer used as pointer *)
| _
| exception Cilfacade.TypeOfError _ -> AD.empty () (* avoid unknown pointer result for non-pointer expression *)
end
| _ -> AD.empty ()
end
| Q.ReachableUkTypes e -> begin
Expand Down

0 comments on commit 204594e

Please sign in to comment.