@@ -423,17 +423,17 @@ void intPointerSourceCaller() {
423
423
intPointerSource (&local);
424
424
sink (local); // $ ast,ir=422:7 ast,ir=423:20
425
425
}
426
- // The IR results for this test _are_ equivalent to the AST ones.
427
- // The IR annotation is just "ir" because the sink of the unitialized source at
428
- // `433:7` (i.e., the declaration `int local[1];`) is value of `local`, but the sink
429
- // of the source from `intPointerSource` value of `*local` (i.e., the indirection node
430
- // of `local`). So unlike AST dataflow, each of these two sinks correspond to a unique
431
- // source, and thus we don't need to attach a location annotation to it.
426
+
427
+
428
+
429
+
430
+
431
+
432
432
void intPointerSourceCaller2 () {
433
433
int local[1 ];
434
434
intPointerSource (local);
435
- sink (local); // $ ast=433:7 ast= 434:20 ir=433:7 ir=434:20 ir
436
- sink (*local); // $ ast=433:7 ast= 434:20 ir=433:7 ir=434:20
435
+ sink (local); // $ ast=434:20 ir SPURIOUS: ast=433:7
436
+ sink (*local); // $ ast=434:20 ir SPURIOUS: ast=433:7
437
437
}
438
438
439
439
void intArraySourceCaller () {
@@ -447,8 +447,8 @@ void intArraySourceCaller() {
447
447
void intArraySourceCaller2 () {
448
448
int local[2 ];
449
449
intArraySource (local, 2 );
450
- sink (local); // $ ast=448:7 ast= 449:18 ir=448:7 ir=449:18 ir
451
- sink (*local); // $ ast=448:7 ast= 449:18 ir=448:7 ir=449:18
450
+ sink (local); // $ ast=449:18 ir SPURIOUS: ast=448:7
451
+ sink (*local); // $ ast=449:18 ir SPURIOUS: ast=448:7
452
452
}
453
453
454
454
// /////////////////////////////////////////////////////////////////////////////
@@ -518,7 +518,7 @@ void uncertain_definition() {
518
518
int clean = 0 ;
519
519
stackArray[0 ] = source ();
520
520
stackArray[1 ] = clean;
521
- sink (stackArray[0 ]); // $ ast=519:19 ir=517:7 ir=519:19 SPURIOUS: ast=517:7
521
+ sink (stackArray[0 ]); // $ ast=519:19 ir SPURIOUS: ast=517:7
522
522
}
523
523
524
524
void set_through_const_pointer (int x, const int **e) // $ ast-def=e ir-def=**e ir-def=*e
@@ -594,7 +594,7 @@ void test_indirect_flow_to_array() {
594
594
int * p = indirect_source ();
595
595
int * xs[2 ];
596
596
xs[0 ] = p;
597
- sink (*xs[0 ]); // $ ir=594:12 MISSING: ast SPURIOUS: ir=595:8
597
+ sink (*xs[0 ]); // $ ir MISSING: ast // the IR source is the indirection of `indirect_source()`.
598
598
}
599
599
600
600
void test_def_by_ref_followed_by_uncertain_write_array (int * p) { // $ ast-def=p ir-def=*p
0 commit comments