From 50ebea5faa4c5bc38cba4053fdb893bb5f9abde1 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Wed, 14 Nov 2018 01:48:34 -0800 Subject: [PATCH] [inferbo] Fix path of allocsite in declaration Reviewed By: mbouaziz Differential Revision: D13057595 fbshipit-source-id: 04bda78c0 --- infer/src/bufferoverrun/bufferOverrunUtils.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/infer/src/bufferoverrun/bufferOverrunUtils.ml b/infer/src/bufferoverrun/bufferOverrunUtils.ml index ab28cee1d..1ba01b4ee 100644 --- a/infer/src/bufferoverrun/bufferOverrunUtils.ml +++ b/infer/src/bufferoverrun/bufferOverrunUtils.ml @@ -157,9 +157,10 @@ module Exec = struct Itv.make_sym ~unsigned:true pname symbol_table (Itv.SymbolPath.length path) new_sym_num ) in + let deref_path = Itv.SymbolPath.index path in let allocsite = let alloc_num = Itv.Counter.next new_alloc_num in - Allocsite.make pname ~node_hash ~inst_num ~dimension:alloc_num ~path:(Some path) + Allocsite.make pname ~node_hash ~inst_num ~dimension:alloc_num ~path:(Some deref_path) in let mem = let arr = @@ -172,13 +173,12 @@ module Exec = struct |> Dom.Mem.init_array_relation allocsite ~offset ~size ~size_exp_opt:None in let deref_loc = Loc.of_allocsite allocsite in - let path = Itv.SymbolPath.index path in let represents_multiple_values = match array_kind with CSymArray_Array -> true | CSymArray_Pointer -> false (* unsound but avoids many FPs for non-array pointers *) in - decl_sym_val pname path tenv ~node_hash location ~represents_multiple_values ~depth deref_loc - typ mem + decl_sym_val pname deref_path tenv ~node_hash location ~represents_multiple_values ~depth + deref_loc typ mem let decl_sym_java_ptr :