[PATCH] D19971: [scan-build] fix warnings emitted on LLVM TargetRecip code baseFix logic error warnings of the type "called C++ object pointer isnull" emitted by Clang Static Analyzer on the following files:- lib/Target/TargetRecip.cpp.

Apelete Seketeli via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 06:51:43 PDT 2016


apelete created this revision.
apelete added a reviewer: spatel.
apelete added a subscriber: llvm-commits.

Signed-off-by: Apelete Seketeli <apelete at seketeli.net>

http://reviews.llvm.org/D19971

Files:
  lib/Target/TargetRecip.cpp

Index: lib/Target/TargetRecip.cpp
===================================================================
--- lib/Target/TargetRecip.cpp
+++ lib/Target/TargetRecip.cpp
@@ -71,7 +71,7 @@
   // Look for an optional setting of the number of refinement steps needed
   // for this type of reciprocal operation.
   size_t RefPos;
-  uint8_t RefSteps;
+  uint8_t RefSteps = 0;
   StringRef RefStepString;
   if (parseRefinementStep(ArgSub, RefPos, RefSteps)) {
     // Split the string for further processing.
@@ -120,7 +120,7 @@
       Val = Val.substr(1);
     
     size_t RefPos;
-    uint8_t RefSteps;
+    uint8_t RefSteps = 0;
     StringRef RefStepString;
     if (parseRefinementStep(Val, RefPos, RefSteps)) {
       // Split the string for further processing.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19971.56280.patch
Type: text/x-patch
Size: 760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160505/983cda96/attachment.bin>


More information about the llvm-commits mailing list