diff --git a/infer/src/bufferoverrun/bufferOverrunDomain.ml b/infer/src/bufferoverrun/bufferOverrunDomain.ml index e4a476c1f..9d8ccfe81 100644 --- a/infer/src/bufferoverrun/bufferOverrunDomain.ml +++ b/infer/src/bufferoverrun/bufferOverrunDomain.ml @@ -269,7 +269,9 @@ module Val = struct of_itv (Itv.set_lb_zero (Itv.of_int max_char)) - let set_itv_updated_by itv_updated_by x = {x with itv_updated_by} + let set_itv_updated_by itv_updated_by x = + {x with itv_updated_by= ItvUpdatedBy.join x.itv_updated_by itv_updated_by} + let set_itv_updated_by_addition = set_itv_updated_by ItvUpdatedBy.Addition diff --git a/infer/tests/codetoanalyze/java/performance/IntTest.java b/infer/tests/codetoanalyze/java/performance/IntTest.java index 9d344ce0e..a14d3887c 100644 --- a/infer/tests/codetoanalyze/java/performance/IntTest.java +++ b/infer/tests/codetoanalyze/java/performance/IntTest.java @@ -36,7 +36,7 @@ class IntTest { } } - void control_var_band_add_constant_FP(int x, int y) { + void control_var_band_add_constant(int x, int y) { int z; for (int i = 0; i < 10; i++) { if (unknown_bool) { diff --git a/infer/tests/codetoanalyze/java/performance/issues.exp b/infer/tests/codetoanalyze/java/performance/issues.exp index 2ef28afb0..af421c3b7 100644 --- a/infer/tests/codetoanalyze/java/performance/issues.exp +++ b/infer/tests/codetoanalyze/java/performance/issues.exp @@ -116,9 +116,8 @@ codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performan codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performance.Cost_test_deps.two_loops():int, 7, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 545, O(1), degree = 0] codetoanalyze/java/performance/EvilCfg.java, EvilCfg.foo(int,int,boolean):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 15] codetoanalyze/java/performance/FieldAccess.java, codetoanalyze.java.performance.FieldAccess.iterate_upto_field_size(codetoanalyze.java.performance.FieldAccess$Test):void, 1, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 2 + 6 ⋅ test.a, O(test.a), degree = 1,{test.a},Loop at line 16] -codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant_FP(int,int):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 41] -codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant_FP(int,int):void, 4, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [,Parameter `x`,Binary operation: ([-oo, +oo] + 1):signed32] -codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant_FP(int,int):void, 6, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [,Parameter `x`,Binary operation: ([-oo, +oo] + 1):signed32] +codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant(int,int):void, 4, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [,Parameter `x`,Binary operation: ([-oo, +oo] + 1):signed32] +codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant(int,int):void, 6, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [,Parameter `x`,Binary operation: ([-oo, +oo] + 1):signed32] codetoanalyze/java/performance/IntTest.java, IntTest.intValue_linear(java.lang.Integer):void, 1, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 2 + 5 ⋅ mKBytesToSend + 3 ⋅ (1+max(0, mKBytesToSend)), O(mKBytesToSend), degree = 1,{1+max(0, mKBytesToSend)},Loop at line 9,{mKBytesToSend},Loop at line 9] codetoanalyze/java/performance/IntTest.java, IntTest.static_Integer_top():void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 15] codetoanalyze/java/performance/IntTest.java, IntTest.static_Integer_top():void, 1, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [,Assignment,Binary operation: ([0, +oo] + 1):signed32]