20001115-1.c: Don't write to nonexistant memory.
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>
Sat, 18 Nov 2000 18:46:15 +0000 (18:46 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 18 Nov 2000 18:46:15 +0000 (10:46 -0800)
        * gcc.c-torture/execute/20001115-1.c: Don't write to nonexistant
        memory.

From-SVN: r37544

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20001115-1.c

index 382b5196762bb07044b0eb2eec9c4fe1da4ea16e..14eca6cee3b6cdc70b2a256f1c6a57022fb8ef08 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * g++.old-deja/g++.pt/instantiate8.C: New test.
index 0e34614b1d5bff44dfdeb40e9fe208d4bec784de..632ad4bc09e85dac06031d93be0d706039074de9 100644 (file)
@@ -1,28 +1,32 @@
 extern void abort (void);
 extern void exit (int);
 
-struct iso_directory_record {
+union iso_directory_record {
+   char carr[4];
+   struct {
            unsigned char name_len [1];
            char name [0];
+   } u;
 } entry;
 
-void set(struct iso_directory_record *);
+void set(union iso_directory_record *);
 
 int main (void)
 {
-   struct iso_directory_record *de;
+   union iso_directory_record *de;
 
    de = &entry;
    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);
    else
      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;
 }