From: Yao Qi Date: Wed, 24 May 2017 21:15:23 +0000 (+0100) Subject: Restrict i387_convert_register_p X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c8f9122ce6e6c00f72914479af57a7b87244554;p=binutils-gdb.git Restrict i387_convert_register_p gdb: 2017-05-24 Yao Qi * i387-tdep.c (i387_convert_register_p): Return false if type code isn't TYPE_CODE_FLT. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1234e1473af..29cd3061a32 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-05-24 Yao Qi + + * i387-tdep.c (i387_convert_register_p): Return false if type + code isn't TYPE_CODE_FLT. + 2017-05-24 Yao Qi * alpha-tdep.c (alpha_convert_register_p): Return true if type diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 92061098e32..925f4e54778 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -341,8 +341,9 @@ i387_convert_register_p (struct gdbarch *gdbarch, int regnum, if (i386_fp_regnum_p (gdbarch, regnum)) { /* Floating point registers must be converted unless we are - accessing them in their hardware type. */ - if (type == i387_ext_type (gdbarch)) + accessing them in their hardware type or TYPE is not float. */ + if (type == i387_ext_type (gdbarch) + || TYPE_CODE (type) != TYPE_CODE_FLT) return 0; else return 1;