* amd64-tdep.c (amd64_return_value): Revert previous change
[deliverable/binutils-gdb.git] / gdb / microblaze-tdep.c
index 9b1ff468a574928130fc7731a7a35c6f5d0d754c..965840040194dd085782d87eb68400b88f7fd192 100644 (file)
@@ -590,21 +590,22 @@ static void
 microblaze_store_return_value (struct type *type, struct regcache *regcache,
                               const gdb_byte *valbuf)
 {
+  int len = TYPE_LENGTH (type);
   gdb_byte buf[8];
 
   memset (buf, 0, sizeof(buf));
 
   /* Integral and pointer return values.  */
 
-  if (TYPE_LENGTH (type) > 4)
+  if (len > 4)
     {
-       gdb_assert (TYPE_LENGTH (type) == 8);
+       gdb_assert (len == 8);
        memcpy (buf, valbuf, 8);
        regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf + 4);
     }
   else
     /* ??? Do we need to do any sign-extension here?  */
-    memcpy (buf + 4 - TYPE_LENGTH (type), valbuf, TYPE_LENGTH (type));
+    memcpy (buf + 4 - len, valbuf, len);
 
   regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
 }
This page took 0.024732 seconds and 4 git commands to generate.