Skip to content

Commit

Permalink
Merging r300267:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
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
------------------------------------------------------------------------
  • Loading branch information
tstellar committed Jun 13, 2017
1 parent a294fb8 commit c0c70fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions llvm/lib/Support/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c0c70fd

Please sign in to comment.