Commit 3734169e by Franz Sirl Committed by Richard Henderson

20001115-1.c: Don't write to nonexistant memory.

        * gcc.c-torture/execute/20001115-1.c: Don't write to nonexistant
        memory.

From-SVN: r37544
parent 311d8afa
2000-11-18 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* gcc.c-torture/execute/20001115-1.c: Don't access nonexistant
memory.
2000-11-17 Nathan Sidwell <nathan@codesourcery.com> 2000-11-17 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/instantiate8.C: New test. * g++.old-deja/g++.pt/instantiate8.C: New test.
......
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
struct iso_directory_record { union iso_directory_record {
char carr[4];
struct {
unsigned char name_len [1]; unsigned char name_len [1];
char name [0]; char name [0];
} u;
} entry; } entry;
void set(struct iso_directory_record *); void set(union iso_directory_record *);
int main (void) int main (void)
{ {
struct iso_directory_record *de; union iso_directory_record *de;
de = &entry; de = &entry;
set(de); set(de);
if (de->name_len[0] == 1 && de->name[0] == 0) if (de->u.name_len[0] == 1 && de->u.name[0] == 0)
exit (0); exit (0);
else else
abort (); abort ();
} }
void set (struct iso_directory_record *p) void set (union iso_directory_record *p)
{ {
p->name_len[0] = 1; p->carr[0] = 1;
p->carr[1] = 0;
return; return;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment