@@ -423,17 +423,17 @@ void intPointerSourceCaller() {
423423 intPointerSource (&local);
424424 sink (local); // $ ast,ir=422:7 ast,ir=423:20
425425}
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+
432432void intPointerSourceCaller2 () {
433433 int local[1 ];
434434 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
437437}
438438
439439void intArraySourceCaller () {
@@ -447,8 +447,8 @@ void intArraySourceCaller() {
447447void intArraySourceCaller2 () {
448448 int local[2 ];
449449 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
452452}
453453
454454// /////////////////////////////////////////////////////////////////////////////
@@ -518,7 +518,7 @@ void uncertain_definition() {
518518 int clean = 0 ;
519519 stackArray[0 ] = source ();
520520 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
522522}
523523
524524void 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() {
594594 int * p = indirect_source ();
595595 int * xs[2 ];
596596 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()`.
598598}
599599
600600void test_def_by_ref_followed_by_uncertain_write_array (int * p) { // $ ast-def=p ir-def=*p
0 commit comments