[PATCH] D23340: [CUDA] Fix CUDA install version parsing.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 17:26:53 PDT 2016


jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added subscribers: Prazek, cfe-commits.

getAsInteger returns true on error.  Oops.

No test because the behavior at the moment is identical with or without
this change.

https://reviews.llvm.org/D23340

Files:
  clang/lib/Driver/ToolChains.cpp

Index: clang/lib/Driver/ToolChains.cpp
===================================================================
--- clang/lib/Driver/ToolChains.cpp
+++ clang/lib/Driver/ToolChains.cpp
@@ -1730,8 +1730,8 @@
   int Major = -1, Minor = -1;
   auto First = V.split('.');
   auto Second = First.second.split('.');
-  if (!First.first.getAsInteger(10, Major) ||
-      !Second.first.getAsInteger(10, Minor))
+  if (First.first.getAsInteger(10, Major) ||
+      Second.first.getAsInteger(10, Minor))
     return CudaVersion::UNKNOWN;
 
   if (Major == 7 && Minor == 0) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23340.67438.patch
Type: text/x-patch
Size: 559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160810/46bbe0c8/attachment.bin>


More information about the cfe-commits mailing list