[Lldb-commits] [PATCH] Quiet Coverity
Justin Hibbits
jrh29 at alumni.cwru.edu
Wed Feb 11 18:25:36 PST 2015
Hi emaste,
Coverity warns that unsigned >= 0 is always true, and k_first_gpr_powerpc happens to be 0. Quiet Coverity by changing that comparison instead to a static_assert(), in case things change in the future.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D7576
Files:
source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
Index: source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
+++ source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
@@ -159,9 +159,10 @@
{ "Altivec/VMX Registers", "vmx", k_num_vmx_registers_powerpc, g_vmx_regnums },
};
+static_assert(k_first_gpr_powerpc == 0, "GPRs must index starting at 0, or fix IsGPR()");
bool RegisterContextPOSIX_powerpc::IsGPR(unsigned reg)
{
- return (reg >= k_first_gpr_powerpc) && (reg <= k_last_gpr_powerpc); // GPR's come first.
+ return (reg <= k_last_gpr_powerpc); // GPR's come first.
}
bool
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7576.19800.patch
Type: text/x-patch
Size: 709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150212/94cc57cc/attachment.bin>
More information about the lldb-commits
mailing list