llvm.org GIT mirror llvm / 6893ead
mmap of a zero length file returns null on some platforms, so hack around it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13121 91177308-0d34-0410-b5e6-96231b3b80d8 Brian Gaeke 16 years ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
4949 std::cerr << "Error: cannot open file '" << Filename << "'\n";
5050 exit(2);
5151 }
52
53 // If mmap decided that the files were empty, it might have returned a
54 // null pointer. If so, make a new, fake pointer -- it shouldn't matter
55 // what it contains, because Len is 0, and it should never be read.
56 if (BufPtr == 0 && Len == 0)
57 BufPtr = new char[1];
5258 }
5359
5460 static bool isNumberChar(char C) {