From 0d5e9d09345a7e1376a63548b87f68fe1b3d86d7 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Fri, 16 Mar 2018 06:18:29 -0700 Subject: [PATCH] [bug hash] strip temporary var names from qualifier Reviewed By: jeremydubreil Differential Revision: D7299776 fbshipit-source-id: da3e484 --- infer/src/backend/InferPrint.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index c8a98ff73..3bf356cea 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -50,9 +50,9 @@ let compute_hash (kind: string) (type_str: string) (proc_name: Typ.Procname.t) ( let base_filename = Filename.basename filename in let hashable_procedure_name = Typ.Procname.hashable_name proc_name in let location_independent_qualifier = - (* Removing the line and column information from the error message to make the - hash invariant when moving the source code in the file *) - Str.global_replace (Str.regexp "\\(line\\|column\\)\\ [0-9]+") "_" qualifier + (* Removing the line,column, and infer temporary variable (e.g., n$67) information from the + error message to make the hash invariant when moving the source code in the file *) + Str.global_replace (Str.regexp "\\(line \\|column \\|n\\$\\)[0-9]+") "_" qualifier in Utils.better_hash (kind, type_str, hashable_procedure_name, base_filename, location_independent_qualifier)