From 89a28d4dccbfed3319baa3c7a86cc080387290c8 Mon Sep 17 00:00:00 2001 From: Kihong Heo Date: Thu, 16 Mar 2017 05:28:48 -0700 Subject: [PATCH] [infer][PR] handle an uncaught exception when converting too large integers to intervals Summary: This bug-fix handles the integer overflow issue (https://github.com/facebook/infer/issues/584) in the buffer overrun checker. Closes https://github.com/facebook/infer/pull/618 Reviewed By: jvillard Differential Revision: D4695475 Pulled By: cristianoc fbshipit-source-id: 3081311 --- infer/src/bufferoverrun/bufferOverrunSemantics.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/bufferoverrun/bufferOverrunSemantics.ml b/infer/src/bufferoverrun/bufferOverrunSemantics.ml index c19698ae3..ecbb350db 100644 --- a/infer/src/bufferoverrun/bufferOverrunSemantics.ml +++ b/infer/src/bufferoverrun/bufferOverrunSemantics.ml @@ -24,7 +24,7 @@ struct let eval_const : Const.t -> Val.t = function - | Const.Cint intlit -> Val.of_int (IntLit.to_int intlit) + | Const.Cint intlit -> (try Val.of_int (IntLit.to_int intlit) with _ -> Val.top_itv) | Const.Cfloat f -> f |> int_of_float |> Val.of_int | _ -> Val.bot (* TODO *)