File tree Expand file tree Collapse file tree 10 files changed +14
-1
lines changed Expand file tree Collapse file tree 10 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -428,8 +428,13 @@ Error BitstreamRemarkParser::processExternalFilePath(
428
428
MemoryBuffer::getFile (FullPath);
429
429
if (std::error_code EC = BufferOrErr.getError ())
430
430
return createFileError (FullPath, EC);
431
+
431
432
TmpRemarkBuffer = std::move (*BufferOrErr);
432
433
434
+ // Don't try to parse the file if it's empty.
435
+ if (TmpRemarkBuffer->getBufferSize () == 0 )
436
+ return make_error<EndOfFileError>();
437
+
433
438
// Create a separate parser used for parsing the separate file.
434
439
ParserHelper = BitstreamParserHelper (TmpRemarkBuffer->getBuffer ());
435
440
// Advance and check until we can parse the meta block.
Original file line number Diff line number Diff line change 22
22
23
23
Remarks compilation:
24
24
for FILE in basic1.c basic2.c basic3.c; do
25
- clang -gline-tables-only -c $FILE -fsave-optimization-record=bitstream -foptimization-remarks -file=/tmp /${FILE%.c}.macho.remarks.x86_64.opt.bitstream -mllvm -remarks-section -o ${FILE%.c}.macho.remarks.x86_64.o
25
+ clang -gline-tables-only -c $FILE -fsave-optimization-record=bitstream -foptimization-record -file=/remarks /${FILE%.c}.macho.remarks.x86_64.opt.bitstream -o ${FILE%.c}.macho.remarks.x86_64.o
26
26
done
27
27
clang basic1.macho.remarks.x86_64.o basic2.macho.remarks.x86_64.o basic3.macho.remarks.x86_64.o -o basic.macho.remarks.x86_64 -Wl,-dead_strip
28
28
Original file line number Diff line number Diff line change
1
+ RUN: rm -rf %t
2
+ RUN: mkdir -p %t
3
+ RUN: cat %p/../Inputs/remarks/basic.macho.remarks.empty.x86_64 > %t/basic.macho.remarks.empty.x86_64
4
+
5
+ RUN: dsymutil -oso-prepend-path=%p/../Inputs -remarks-prepend-path=%p/../Inputs %t/basic.macho.remarks.empty.x86_64
6
+
7
+ Check that the remark file in the bundle does not exist:
8
+ RUN: not cat %t/basic.macho.remarks.empty.x86_64.dSYM/Contents/Resources/Remarks/basic.macho.remarks.empty.x86_64 2>&1
You can’t perform that action at this time.
0 commit comments