[inferbo] Do not expose unsafe Itv.lb/ub

Reviewed By: skcho

Differential Revision: D13533467

fbshipit-source-id: 4a810a411
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent ddc15ad663
commit 2ebbf554e5

@ -853,9 +853,11 @@ module Make (Manager : Manager_S) = struct
let itv_of sym itv = let itv_of sym itv =
if Itv.is_empty itv then empty match itv with
else | Bottom ->
let lb, ub = (Itv.lb itv, Itv.ub itv) in empty
| NonBottom itv_pure ->
let lb, ub = (Itv.ItvPure.lb itv_pure, Itv.ItvPure.ub itv_pure) in
Option.value_map (SymExp.of_sym sym) ~default:empty ~f:(fun sym_exp -> Option.value_map (SymExp.of_sym sym) ~default:empty ~f:(fun sym_exp ->
let tcons_lb = let tcons_lb =
Option.map (Itv.Bound.is_const lb) ~f:(fun lb -> Option.map (Itv.Bound.is_const lb) ~f:(fun lb ->

@ -10,7 +10,6 @@
open! IStd open! IStd
open! AbstractDomain.Types open! AbstractDomain.Types
module F = Format module F = Format
module L = Logging
module Bound = Bounds.Bound module Bound = Bounds.Bound
open Ints open Ints
module SymbolPath = Symb.SymbolPath module SymbolPath = Symb.SymbolPath
@ -443,20 +442,6 @@ let bot : t = Bottom
let top : t = NonBottom ItvPure.top let top : t = NonBottom ItvPure.top
let lb : t -> Bound.t = function
| NonBottom x ->
ItvPure.lb x
| Bottom ->
L.(die InternalError) "lower bound of bottom"
let ub : t -> Bound.t = function
| NonBottom x ->
ItvPure.ub x
| Bottom ->
L.(die InternalError) "upper bound of bottom"
let get_bound itv (be : Symb.BoundEnd.t) = let get_bound itv (be : Symb.BoundEnd.t) =
match (itv, be) with match (itv, be) with
| Bottom, _ -> | Bottom, _ ->

@ -139,10 +139,6 @@ val is_one : t -> bool
val is_mone : t -> bool val is_mone : t -> bool
val lb : t -> Bound.t
val ub : t -> Bound.t
val get_bound : t -> Symb.BoundEnd.t -> Bound.t bottom_lifted val get_bound : t -> Symb.BoundEnd.t -> Bound.t bottom_lifted
val is_false : t -> bool val is_false : t -> bool

Loading…
Cancel
Save