From 061bb2d799c1bd3bd8ea1ddc72b6d07580c33553 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Sun, 10 Jul 2016 11:35:00 -0700 Subject: [PATCH] Change length of Dsizeof from an exp to a dexp Summary: Change length of Dsizeof from an exp to a dexp. This make a little progress toward reducing the types that must be mutually recursive with exp. Reviewed By: sblackshear Differential Revision: D3541337 fbshipit-source-id: 95d1f70 --- infer/src/IR/Sil.re | 2 +- infer/src/IR/Sil.rei | 2 +- infer/src/backend/errdesc.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infer/src/IR/Sil.re b/infer/src/IR/Sil.re index e9181afd2..6adc00788 100644 --- a/infer/src/IR/Sil.re +++ b/infer/src/IR/Sil.re @@ -420,7 +420,7 @@ type dexp = | Darray of dexp dexp | Dbinop of binop dexp dexp | Dconst of const - | Dsizeof of Typ.t (option exp) Subtype.t + | Dsizeof of Typ.t (option dexp) Subtype.t | Dderef of dexp | Dfcall of dexp (list dexp) Location.t call_flags | Darrow of dexp Ident.fieldname diff --git a/infer/src/IR/Sil.rei b/infer/src/IR/Sil.rei index 33ef4947e..2e7b592a0 100644 --- a/infer/src/IR/Sil.rei +++ b/infer/src/IR/Sil.rei @@ -147,7 +147,7 @@ type dexp = | Darray of dexp dexp | Dbinop of binop dexp dexp | Dconst of const - | Dsizeof of Typ.t (option exp) Subtype.t + | Dsizeof of Typ.t (option dexp) Subtype.t | Dderef of dexp | Dfcall of dexp (list dexp) Location.t call_flags | Darrow of dexp Ident.fieldname diff --git a/infer/src/backend/errdesc.ml b/infer/src/backend/errdesc.ml index c8d5ebcf8..cb34e2562 100644 --- a/infer/src/backend/errdesc.ml +++ b/infer/src/backend/errdesc.ml @@ -387,7 +387,7 @@ and _exp_rv_dexp (_seen : Sil.ExpSet.t) node e : Sil.dexp option = _exp_rv_dexp seen node e1 | Sil.Sizeof (typ, len, sub) -> if verbose then (L.d_str "exp_rv_dexp: type "; Sil.d_exp e; L.d_ln ()); - Some (Sil.Dsizeof (typ, len, sub)) + Some (Sil.Dsizeof (typ, Option.map_default (_exp_rv_dexp seen node) None len, sub)) | _ -> if verbose then (L.d_str "exp_rv_dexp: no match for "; Sil.d_exp e; L.d_ln ()); None