]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't assume a valueT is 4 bytes.
authorNick Clifton <nickc@redhat.com>
Thu, 5 May 2005 10:57:06 +0000 (10:57 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 5 May 2005 10:57:06 +0000 (10:57 +0000)
gas/ChangeLog
gas/config/tc-vax.c

index 749ba16da4818855a53b57c5589ca0f98f65caf6..c036506cab1b891a1d03bc5ee1ca805448e8e927 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-05  Matt Thomas <matt@3am-software.com>
+
+       * config/tc-vax.c (md_assemble): Don't assume a valueT is 4
+       bytes.
+
 2005-05-05  Nick Clifton  <nickc@redhat.com>
 
        * Update the address and phone number of the FSF organization in
index 461f58c08408aec5c91b0e25b9d60a590e171d63..7934aea9289cde457189db2599465ca8ad85047c 100644 (file)
@@ -1190,18 +1190,17 @@ md_assemble (instruction_string)
                          p[0] = (operandP->vop_mode << 4) | 0xF;
                          if ((is_absolute) && (expP->X_op != O_big))
                            {
-                             /*
-                              * If nbytes > 4, then we are scrod. We
-                              * don't know if the high order bytes
-                              * are to be 0xFF or 0x00.  BSD4.2 & RMS
-                              * say use 0x00. OK --- but this
-                              * assembler needs ANOTHER rewrite to
-                              * cope properly with this bug.  */
-                             md_number_to_chars (p + 1, this_add_number, min (4, nbytes));
-                             if (nbytes > 4)
-                               {
-                                 memset (p + 5, '\0', nbytes - 4);
-                               }
+                             /* If nbytes > 4, then we are scrod. We
+                                don't know if the high order bytes
+                                are to be 0xFF or 0x00.  BSD4.2 & RMS
+                                say use 0x00. OK --- but this
+                                assembler needs ANOTHER rewrite to
+                                cope properly with this bug.  */
+                             md_number_to_chars (p + 1, this_add_number,
+                                                 min (sizeof (valueT),
+                                                      (size_t) nbytes));
+                             if ((size_t) nbytes > sizeof (valueT))
+                               memset (p + 5, '\0', nbytes - sizeof (valueT));
                            }
                          else
                            {