File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed
compiler-rt/test/asan/TestCases Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 99int main () {
1010 const wchar_t *start = L" X means " ;
1111 const wchar_t *append = L" dog" ;
12- wchar_t goodDst[12 ];
12+ wchar_t goodArray[12 ];
13+ wchar_t *volatile goodDst = goodArray;
1314 wcscpy (goodDst, start);
1415 wcscat (goodDst, append);
1516
16- wchar_t badDst[9 ];
17+ wchar_t badArray[9 ];
18+ wchar_t *volatile badDst = badArray;
1719 wcscpy (badDst, start);
1820 fprintf (stderr, " Good so far.\n " );
1921 // CHECK-DAG: Good so far.
Original file line number Diff line number Diff line change 88
99int main () {
1010 const wchar_t *src = L" X means dog" ;
11- wchar_t goodDst[12 ];
11+ wchar_t goodArray[12 ];
12+ wchar_t *volatile goodDst = goodArray;
1213 wcscpy (goodDst, src);
1314
14- wchar_t badDst[7 ];
15+ wchar_t badArray[7 ];
16+ wchar_t *volatile badDst = badArray;
1517 fprintf (stderr, " Good so far.\n " );
1618 // CHECK-DAG: Good so far.
1719 fflush (stderr);
Original file line number Diff line number Diff line change 99int main () {
1010 const wchar_t *start = L" X means " ;
1111 const wchar_t *append = L" dog" ;
12- wchar_t goodDst[15 ];
12+ wchar_t goodArray[15 ];
13+ wchar_t *volatile goodDst = goodArray;
1314 wcscpy (goodDst, start);
1415 wcsncat (goodDst, append, 5 );
1516
16- wchar_t badDst[11 ];
17+ wchar_t badArray[11 ];
18+ wchar_t *volatile badDst = badArray;
1719 wcscpy (badDst, start);
1820 wcsncat (badDst, append, 1 );
1921 fprintf (stderr, " Good so far.\n " );
Original file line number Diff line number Diff line change 88
99int main () {
1010 const wchar_t *src = L" X means dog" ;
11- wchar_t goodDst[12 ];
11+ wchar_t goodArray[12 ];
12+ wchar_t *volatile goodDst = goodArray;
1213 wcsncpy (goodDst, src, 12 );
1314
14- wchar_t badDst[7 ];
15+ wchar_t badArray[7 ];
16+ wchar_t *volatile badDst = badArray;
1517 wcsncpy (badDst, src, 7 ); // This should still work.
1618 fprintf (stderr, " Good so far.\n " );
1719 // CHECK-DAG: Good so far.
You can’t perform that action at this time.
0 commit comments