[llvm-branch-commits] [llvm-branch] r305264 - Merging r300267:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jun 12 18:46:45 PDT 2017
Author: tstellar
Date: Mon Jun 12 20:46:44 2017
New Revision: 305264
URL: http://llvm.org/viewvc/llvm-project?rev=305264&view=rev
Log:
Merging r300267:
------------------------------------------------------------------------
r300267 | tejohnson | 2017-04-13 17:51:49 -0400 (Thu, 13 Apr 2017) | 11 lines
[Support] Fix ErrorOr assertion when /proc/cpuinfo doesn't exist.
The ErrorOr should not be dereferenced on the error path.
Patch by Jacob Young
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32032
------------------------------------------------------------------------
Modified:
llvm/branches/release_40/lib/Support/Host.cpp
Modified: llvm/branches/release_40/lib/Support/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_40/lib/Support/Host.cpp?rev=305264&r1=305263&r2=305264&view=diff
==============================================================================
--- llvm/branches/release_40/lib/Support/Host.cpp (original)
+++ llvm/branches/release_40/lib/Support/Host.cpp Mon Jun 12 20:46:44 2017
@@ -1232,6 +1232,7 @@ static int computeHostNumPhysicalCores()
if (std::error_code EC = Text.getError()) {
llvm::errs() << "Can't read "
<< "/proc/cpuinfo: " << EC.message() << "\n";
+ return -1;
}
SmallVector<StringRef, 8> strs;
(*Text)->getBuffer().split(strs, "\n", /*MaxSplit=*/-1,
More information about the llvm-branch-commits
mailing list