@@ -7,7 +7,7 @@ void source_ref(int *toTaint) { // $ ir-def=*toTaint ast-def=toTaint
77void source_ref (char *toTaint) { // $ ir-def=*toTaint ast-def=toTaint
88 *toTaint = source ();
99}
10- void modify_copy (int * ptr) { // $ ast-def=ptr
10+ void modify_copy (int * ptr) { // $ ast-def=ptr ir-def=*ptr
1111 int deref = *ptr;
1212 int * other = &deref;
1313 source_ref (other);
@@ -19,7 +19,7 @@ void test_output_copy() {
1919 sink (x); // clean
2020}
2121
22- void modify (int * ptr) { // $ ast-def=ptr
22+ void modify (int * ptr) { // $ ast-def=ptr ir-def=*ptr
2323 int * deref = ptr;
2424 int * other = &*deref;
2525 source_ref (other);
@@ -31,7 +31,7 @@ void test_output() {
3131 sink (x); // $ ir MISSING: ast
3232}
3333
34- void modify_copy_of_pointer (int * p, unsigned len) { // $ ast-def=p
34+ void modify_copy_of_pointer (int * p, unsigned len) { // $ ast-def=p ir-def=*p
3535 int * p2 = new int [len];
3636 for (unsigned i = 0 ; i < len; ++i) {
3737 p2[i] = p[i];
@@ -46,7 +46,7 @@ void test_modify_copy_of_pointer() {
4646 sink (x[0 ]); // $ SPURIOUS: ast // clean
4747}
4848
49- void modify_pointer (int * p, unsigned len) { // $ ast-def=p
49+ void modify_pointer (int * p, unsigned len) { // $ ast-def=p ir-def=*p
5050 int ** p2 = &p;
5151 for (unsigned i = 0 ; i < len; ++i) {
5252 *p2[i] = p[i];
@@ -63,17 +63,17 @@ void test_modify_of_pointer() {
6363
6464char * strdup (const char * p);
6565
66- void modify_copy_via_strdup (char * p) { // $ ast-def=p
66+ void modify_copy_via_strdup (char * p) { // $ ast-def=p ir-def=*p
6767 char * p2 = strdup (p);
6868 source_ref (p2);
6969}
7070
71- void test_modify_copy_via_strdup (char * p) { // $ ast-def=p
71+ void test_modify_copy_via_strdup (char * p) { // $ ast-def=p ir-def=*p
7272 modify_copy_via_strdup (p);
7373 sink (*p); // clean
7474}
7575
76- int * deref (int ** p) { // $ ast-def=p
76+ int * deref (int ** p) { // $ ast-def=p ir-def=*p ir-def=**p
7777 int * q = *p;
7878 return q;
7979}
@@ -90,7 +90,7 @@ void addtaint1(int* q) { // $ ast-def=q ir-def=*q
9090 *q = source ();
9191}
9292
93- void addtaint2 (int ** p) { // $ ast-def=p
93+ void addtaint2 (int ** p) { // $ ast-def=p ir-def=*p ir-def=**p
9494 int * q = *p;
9595 addtaint1 (q);
9696}
@@ -106,13 +106,13 @@ using size_t = decltype(sizeof(int));
106106
107107void * memcpy (void * dest, const void * src, size_t );
108108
109- void modify_copy_via_memcpy (char * p) { // $ ast-def=p
109+ void modify_copy_via_memcpy (char * p) { // $ ast-def=p ir-def=*p
110110 char * dest;
111111 char * p2 = (char *)memcpy (dest, p, 10 );
112112 source_ref (p2);
113113}
114114
115- void test_modify_copy_via_memcpy (char * p) { // $ ast-def=p
115+ void test_modify_copy_via_memcpy (char * p) { // $ ast-def=p ir-def=*p
116116 modify_copy_via_memcpy (p);
117117 sink (*p); // clean
118118}
@@ -134,29 +134,29 @@ void source_ref_ref(char** toTaint) { // $ ast-def=toTaint ir-def=*toTaint ir-de
134134// This function copies the value of **p into a new location **p2 and then
135135// taints **p. Thus, **p does not contain tainted data after returning from
136136// this function.
137- void modify_copy_via_strdup_ptr_001 (char ** p) { // $ ast-def=p
137+ void modify_copy_via_strdup_ptr_001 (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
138138 // **p -> **p2
139139 char ** p2 = strdup_ptr_001 (p);
140140 // source -> **p2
141141 source_ref_ref (p2);
142142}
143143
144- void test_modify_copy_via_strdup_001 (char ** p) { // $ ast-def=p
144+ void test_modify_copy_via_strdup_001 (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
145145 modify_copy_via_strdup_ptr_001 (p);
146146 sink (**p); // clean
147147}
148148
149149// This function copies the value of *p into a new location *p2 and then
150150// taints **p2. Thus, **p contains tainted data after returning from this
151151// function.
152- void modify_copy_via_strdup_ptr_011 (char ** p) { // $ ast-def=p
152+ void modify_copy_via_strdup_ptr_011 (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
153153 // **p -> **p2 and *p -> *p2
154154 char ** p2 = strdup_ptr_011 (p);
155155 // source -> **p2
156156 source_ref_ref (p2);
157157}
158158
159- void test_modify_copy_via_strdup_011 (char ** p) { // $ ast-def=p
159+ void test_modify_copy_via_strdup_011 (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
160160 modify_copy_via_strdup_ptr_011 (p);
161161 sink (**p); // $ ir MISSING: ast
162162}
@@ -171,7 +171,7 @@ void source_ref_2(char** toTaint) { // $ ast-def=toTaint ir-def=*toTaint ir-def=
171171// This function copies the value of p into a new location p2 and then
172172// taints *p2. Thus, *p contains tainted data after returning from this
173173// function.
174- void modify_copy_via_strdup_ptr_111_taint_ind (char ** p) { // $ ast-def=p
174+ void modify_copy_via_strdup_ptr_111_taint_ind (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
175175 // **p -> **p2, *p -> *p2, and p -> p2
176176 char ** p2 = strdup_ptr_111 (p);
177177 // source -> *p2
@@ -180,15 +180,15 @@ void modify_copy_via_strdup_ptr_111_taint_ind(char** p) { // $ ast-def=p
180180
181181void sink (char *);
182182
183- void test_modify_copy_via_strdup_111_taint_ind (char ** p) { // $ ast-def=p
183+ void test_modify_copy_via_strdup_111_taint_ind (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
184184 modify_copy_via_strdup_ptr_111_taint_ind (p);
185185 sink (*p); // $ ir MISSING: ast
186186}
187187
188188// This function copies the value of p into a new location p2 and then
189189// taints **p2. Thus, **p contains tainted data after returning from this
190190// function.
191- void modify_copy_via_strdup_ptr_111_taint_ind_ind (char ** p) { // $ ast-def=p
191+ void modify_copy_via_strdup_ptr_111_taint_ind_ind (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
192192 // **p -> **p2, *p -> *p2, and p -> p2
193193 char ** p2 = strdup_ptr_111 (p);
194194 // source -> **p2
@@ -197,7 +197,7 @@ void modify_copy_via_strdup_ptr_111_taint_ind_ind(char** p) { // $ ast-def=p
197197
198198void sink (char *);
199199
200- void test_modify_copy_via_strdup_111_taint_ind_ind (char ** p) { // $ ast-def=p
200+ void test_modify_copy_via_strdup_111_taint_ind_ind (char ** p) { // $ ast-def=p ir-def=*p ir-def=**p
201201 modify_copy_via_strdup_ptr_111_taint_ind_ind (p);
202202 sink (**p); // $ ir MISSING: ast
203203}
0 commit comments