@@ -381,30 +381,12 @@ int *symbolicExtent(int arg) {
381381 return 0 ;
382382 int * mem = (int * )malloc (arg );
383383
384- // TODO: without the following reference to 'arg', the analyzer would discard
385- // the range information about (the symbolic value of) 'arg'. This is
386- // incorrect because while the variable itself is inaccessible, it becomes
387- // the symbolic extent of 'mem', so we still want to reason about its
388- // potential values.
389- (void )arg ;
390-
391384 mem [8 ] = -2 ;
392385 // expected-warning@-1 {{Out of bound access to memory after the end of the heap area}}
393386 // expected-note@-2 {{Access of 'int' element in the heap area at index 8}}
394387 return mem ;
395388}
396389
397- int * symbolicExtentDiscardedRangeInfo (int arg ) {
398- // This is a copy of the case 'symbolicExtent' without the '(void)arg' hack.
399- // TODO: if the analyzer can detect the out-of-bounds access within this
400- // testcase, then remove this and the `(void)arg` hack from `symbolicExtent`.
401- if (arg >= 5 )
402- return 0 ;
403- int * mem = (int * )malloc (arg );
404- mem [8 ] = -2 ;
405- return mem ;
406- }
407-
408390void symbolicIndex (int arg ) {
409391 // expected-note@+2 {{Assuming 'arg' is >= 12}}
410392 // expected-note@+1 {{Taking true branch}}
@@ -426,9 +408,5 @@ int *nothingIsCertain(int x, int y) {
426408 // {{Access of 'int' element in the heap area at an overflowing index}}
427409 // but apparently the analyzer isn't smart enough to deduce this.
428410
429- // Keep constraints alive. (Without this, the overeager garbage collection of
430- // constraints would _also_ prevent the intended behavior in this testcase.)
431- (void )x ;
432-
433411 return mem ;
434412}
0 commit comments