From a055833eb3793883b11fdc4273b56d4038ad4dd9 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Wed, 27 Jun 2018 09:16:59 -0700 Subject: [PATCH] [infer][ondemand] assert that the callbacks are set before retrieving the procedure description Summary: This is make the callbacks are always set instead of silently returning `None` Reviewed By: ngorogiannis Differential Revision: D8651971 fbshipit-source-id: 7cd1c02 --- infer/src/backend/ondemand.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer/src/backend/ondemand.ml b/infer/src/backend/ondemand.ml index 35f104bb1..032311e6c 100644 --- a/infer/src/backend/ondemand.ml +++ b/infer/src/backend/ondemand.ml @@ -240,4 +240,5 @@ let clear_cache () = Typ.Procname.Hash.clear (Lazy.force cached_results) (** Find a proc desc for the procedure, perhaps loading it from disk. *) let get_proc_desc callee_pname = - match !callbacks_ref with Some callbacks -> callbacks.get_proc_desc callee_pname | None -> None + let callbacks = Option.value_exn !callbacks_ref in + callbacks.get_proc_desc callee_pname