]> granicus.if.org Git - clang/commitdiff
[CUDA] Fix CUDA install version parsing.
authorJustin Lebar <jlebar@google.com>
Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)
committerJustin Lebar <jlebar@google.com>
Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)
Summary:
getAsInteger returns true on error.  Oops.

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

Reviewers: tra

Subscribers: cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D23340

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278733 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index fe866dfef3b2094a075bc920de691589f63c462e..4d438c2355dc877b6859c239d7176d30e84347b6 100644 (file)
@@ -1730,8 +1730,8 @@ static CudaVersion ParseCudaVersionFile(llvm::StringRef V) {
   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) {