libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH] Change tests in access_fpreg function to accep


From: menantea
Subject: [Libunwind-devel] [PATCH] Change tests in access_fpreg function to accept fp and v registers.
Date: Fri, 15 Jan 2016 14:19:06 +0100

From: Guy Menanteau <address@hidden>

---
 src/ppc64/Ginit.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/ppc64/Ginit.c b/src/ppc64/Ginit.c
index 0740961..3fdeaee 100644
--- a/src/ppc64/Ginit.c
+++ b/src/ppc64/Ginit.c
@@ -169,13 +169,11 @@ access_fpreg (unw_addr_space_t as, unw_regnum_t reg, 
unw_fpreg_t *val,
   ucontext_t *uc = arg;
   unw_fpreg_t *addr;
 
-  if ((reg - UNW_PPC64_F0) < 0)
+  /* Allow only 32 fregs and 32 vregs */
+  if ( !(  ((unsigned) (reg - UNW_PPC64_F0) < 32)
+         ||((unsigned) (reg - UNW_PPC64_V0) < 32)))
     goto badreg;
 
-  if ((unsigned) (reg - UNW_PPC64_V0) >= 32)
-    goto badreg;
-
-
   addr = uc_addr (uc, reg);
   if (!addr)
     goto badreg;
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]