[Lldb-commits] [lldb] r228547 - Fix off-by-one IsGPR().

Justin Hibbits jrh29 at ALUMNI.cwru.edu
Sun Feb 8 13:23:24 PST 2015


Author: jhibbits
Date: Sun Feb  8 15:23:23 2015
New Revision: 228547

URL: http://llvm.org/viewvc/llvm-project?rev=228547&view=rev
Log:
Fix off-by-one IsGPR().

f0 was being counted as a GPR, due to the check in IsGPR().  Correct it by
looking at the precise GPR range.

Modified:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp?rev=228547&r1=228546&r2=228547&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp Sun Feb  8 15:23:23 2015
@@ -161,7 +161,7 @@ g_reg_sets_powerpc[k_num_register_sets]
 
 bool RegisterContextPOSIX_powerpc::IsGPR(unsigned reg)
 {
-    return reg <= k_num_gpr_registers_powerpc;   // GPR's come first.
+    return (reg >= k_first_gpr_powerpc) && (reg <= k_last_gpr_powerpc);   // GPR's come first.
 }
 
 bool





More information about the lldb-commits mailing list