Skip to content
Snippets Groups Projects
Commit 449c3ef9 authored by Tom Stellard's avatar Tom Stellard
Browse files

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
------------------------------------------------------------------------

llvm-svn: 305264
parent fcf5f77b
No related branches found
No related tags found
No related merge requests found
...@@ -1232,6 +1232,7 @@ static int computeHostNumPhysicalCores() { ...@@ -1232,6 +1232,7 @@ static int computeHostNumPhysicalCores() {
if (std::error_code EC = Text.getError()) { if (std::error_code EC = Text.getError()) {
llvm::errs() << "Can't read " llvm::errs() << "Can't read "
<< "/proc/cpuinfo: " << EC.message() << "\n"; << "/proc/cpuinfo: " << EC.message() << "\n";
return -1;
} }
SmallVector<StringRef, 8> strs; SmallVector<StringRef, 8> strs;
(*Text)->getBuffer().split(strs, "\n", /*MaxSplit=*/-1, (*Text)->getBuffer().split(strs, "\n", /*MaxSplit=*/-1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment