Memory leaks and ineffective bounds checking in wasm_scan
[deliverable/binutils-gdb.git] / gdb / microblaze-tdep.c
index 0cb963380150751792108a0183601da22b526023..17871229c8074eb4247f22e38130ded50778cc95 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Xilinx MicroBlaze.
 
-   Copyright (C) 2009-2018 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -353,12 +353,13 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
         instruction.  */
 
       {
-       unsigned op = (unsigned)insn >> 26;
+       unsigned ctrl_op = (unsigned)insn >> 26;
 
        /* continue if not control flow (branch, return).  */
-       if (op != 0x26 && op != 0x27 && op != 0x2d && op != 0x2e && op != 0x2f)
+       if (ctrl_op != 0x26 && ctrl_op != 0x27 && ctrl_op != 0x2d
+           && ctrl_op != 0x2e && ctrl_op != 0x2f)
          continue;
-       else if (op == 0x2c)
+       else if (ctrl_op == 0x2c)
          continue;    /* continue if imm.  */
       }
 
@@ -529,17 +530,17 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
   switch (TYPE_LENGTH (type))
     {
       case 1:  /* return last byte in the register.  */
-       regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
+       regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
        memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 1, 1);
        return;
       case 2:  /* return last 2 bytes in register.  */
-       regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
+       regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
        memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 2, 2);
        return;
       case 4:  /* for sizes 4 or 8, copy the required length.  */
       case 8:
-       regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
-       regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf+4);
+       regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
+       regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM + 1, buf+4);
        memcpy (valbuf, buf, TYPE_LENGTH (type));
        return;
       default:
@@ -573,13 +574,13 @@ microblaze_store_return_value (struct type *type, struct regcache *regcache,
     {
        gdb_assert (len == 8);
        memcpy (buf, valbuf, 8);
-       regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf + 4);
+       regcache->cooked_write (MICROBLAZE_RETVAL_REGNUM+1, buf + 4);
     }
   else
     /* ??? Do we need to do any sign-extension here?  */
     memcpy (buf + 4 - len, valbuf, len);
 
-  regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
+  regcache->cooked_write (MICROBLAZE_RETVAL_REGNUM, buf);
 }
 
 static enum return_value_convention
This page took 0.027115 seconds and 4 git commands to generate.