diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1996-02-29 10:46:58 -0800 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1996-02-29 10:46:58 -0800 |
commit | 2491d2395347515f342a64e91a15f00826dfcb31 (patch) | |
tree | cee93d60477387c2f524c79696277020fd4fd303 /gcc | |
parent | c3d4f633e6de30191fc1d3db778df83915a9bfdf (diff) | |
download | gcc-2491d2395347515f342a64e91a15f00826dfcb31.zip gcc-2491d2395347515f342a64e91a15f00826dfcb31.tar.gz gcc-2491d2395347515f342a64e91a15f00826dfcb31.tar.bz2 |
varasm.c (compare_constant_1): For a SET_TYPE CONSTRUCTOR, first extract and compare the set length.
* varasm.c (compare_constant_1): For a SET_TYPE CONSTRUCTOR,
first extract and compare the set length.
* varasm.c (record_constant_1): For SET_TYPE CONSTRUCTOR,
permanent_obstack.next_free is *end* of available space.
From-SVN: r11385
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/varasm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index f9f5dd0..9b83110 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2428,9 +2428,12 @@ compare_constant_1 (exp, p) } else if (code == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE) { - len = int_size_in_bytes (TREE_TYPE (exp)); + int xlen = len = int_size_in_bytes (TREE_TYPE (exp)); strp = (char*) alloca (len); get_set_constructor_bytes (exp, (unsigned char *) strp, len); + if (bcmp ((char *) &xlen, p, sizeof xlen)) + return 0; + p += sizeof xlen; } else if (code == CONSTRUCTOR) { @@ -2585,7 +2588,8 @@ record_constant_1 (exp) obstack_grow (&permanent_obstack, &nbytes, sizeof (nbytes)); obstack_blank (&permanent_obstack, nbytes); get_set_constructor_bytes - (exp, (unsigned char *) permanent_obstack.next_free, nbytes); + (exp, (unsigned char *) permanent_obstack.next_free-nbytes, + nbytes); return; } else |