From 6d5e094a2b4d9b6d1cbfc6b47490f1bc0b5ce13a Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Sat, 26 Feb 2011 23:49:19 +0000 Subject: [PATCH] 2011-02-26 Michael Snyder * i387-tdep.c (i387_supply_fxsave): Avoid shadowing a function param with a local variable of the same name. --- gdb/ChangeLog | 3 ++- gdb/i387-tdep.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e33ade5ff0..6e7188a606 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,7 +1,8 @@ 2011-02-26 Michael Snyder - * i387-tdep.c (i387_supply_xsave): Avoid shadowing a function + * i387-tdep.c (i387_supply_fxsave): Avoid shadowing a function param with a local variable of the same name. + (i387_supply_xsave): Ditto. * linux-low.c (linux_nat_xfer_osdata): Rename local variable so that it does not shadow a function parameter. diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 826746667e..122bd83a39 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -587,9 +587,9 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave) if (val[0] & (1 << fpreg)) { - int regnum = (fpreg + 8 - top) % 8 - + I387_ST0_REGNUM (tdep); - tag = i387_tag (FXSAVE_ADDR (tdep, regs, regnum)); + int thisreg = (fpreg + 8 - top) % 8 + + I387_ST0_REGNUM (tdep); + tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg)); } else tag = 3; /* Empty */ -- 2.34.1