1 /* bug-2347.c
2    An bug in marking rematerializeable variables
3  */
4 
5 #include <testfwk.h>
6 
7 #include <string.h>
8 
9 const unsigned char star_star_filename[] = { '*', '.', '*', 0xff };
10 
11 void
dos_catalog(const char * filename)12 dos_catalog(const char *filename)
13 {
14         char    filename_copy[10];
15         int     len = 10;
16 
17         if (filename == NULL)
18                 filename = star_star_filename;
19 
20         len = strlen(filename);
21 
22         memcpy(filename_copy, filename, len); // This memcpy() always used star_star_filename as source.
23 
24 	ASSERT(filename_copy[0] == 'X');
25 }
26 
testBug(void)27 void testBug(void)
28 {
29 	dos_catalog("X");
30 }
31 
32