[inferbo] Prettier field name for Java in traces

Reviewed By: ngorogiannis

Differential Revision: D13505750

fbshipit-source-id: f9a322449
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent dfd725d46c
commit 809100d612

@ -126,7 +126,7 @@ module Loc = struct
| Field (Allocsite (Allocsite.Known {path= Some (SP.Deref (SP.Deref_CPointer, p))}), f) ->
F.fprintf fmt "%a->%s" (SP.pp_partial_paren ~paren:true) p (Typ.Fieldname.to_flat_string f)
| Field (l, f) ->
F.fprintf fmt "%a.%a" (pp_paren ~paren:true) l Typ.Fieldname.pp f
F.fprintf fmt "%a.%s" (pp_paren ~paren:true) l (Typ.Fieldname.to_flat_string f)
let pp = pp_paren ~paren:false

@ -0,0 +1,40 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package codetoanalyze.java.bufferoverrun;
/* Mimics https://fburl.com/f61h6rbl */
class CompressedData {
class C {
public static final int CCI = 4;
}
class DI {
int s;
}
class D {
final DI[] cci = new DI[C.CCI];
int cis;
}
int yy;
int decompressData(D d) {
int output = 0;
DI di;
final int cis = d.cis;
for (int y = 0; y < yy; ++y) {
for (int ci = 0; ci < cis; ++ci) {
di = d.cci[ci];
final int s = di.s;
output = y * s;
}
}
return output;
}
}

@ -1 +1,2 @@
codetoanalyze/java/bufferoverrun/Array.java, codetoanalyze.java.bufferoverrun.Array.collection_add_zero_Bad():java.util.ArrayList, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Assignment,Array access: Offset: 0 Size: 0]
codetoanalyze/java/bufferoverrun/CompressedData.java, codetoanalyze.java.bufferoverrun.CompressedData.decompressData(codetoanalyze.java.bufferoverrun.CompressedData$D):int, 9, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,<RHS trace>,Assignment,Binary operation: ([0, this.yy.ub - 1] × [-oo, +oo]):signed32]

Loading…
Cancel
Save