diff --git a/infer/src/IR/Pvar.re b/infer/src/IR/Pvar.re index 54a75a576..86b829ea3 100644 --- a/infer/src/IR/Pvar.re +++ b/infer/src/IR/Pvar.re @@ -251,17 +251,15 @@ let tmp_prefix = "0$?%__sil_tmp"; /** return true if [pvar] is a temporary variable generated by the frontend */ let is_frontend_tmp pvar => { - /* Check whether the program variable is a temporary one generated by sawja */ - let is_sawja_tmp name => - String.is_prefix prefix::"$irvar" name || - String.is_prefix prefix::"$T" name || - String.is_prefix prefix::"$bc" name || String.is_prefix prefix::"CatchVar" name; + /* Check whether the program variable is a temporary one generated by Sawja, javac, or some other + bytecode/name generation pass. valid java identifiers cannot contain `$` */ + let is_bytecode_tmp name => String.contains name '$' || String.is_prefix prefix::"CatchVar" name; /* Check whether the program variable is generated by [mk_tmp] */ let is_sil_tmp name => String.is_prefix prefix::tmp_prefix name; let name = to_string pvar; is_sil_tmp name || ( switch pvar.pv_kind { - | Local_var pname => Procname.is_java pname && is_sawja_tmp name + | Local_var pname => Procname.is_java pname && is_bytecode_tmp name | _ => false } )