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 @@ -425,8 +425,13 @@ Error BitstreamRemarkParser::processExternalFilePath(
425
425
MemoryBuffer::getFile (FullPath);
426
426
if (std::error_code EC = BufferOrErr.getError ())
427
427
return createFileError (FullPath, EC);
428
+
428
429
TmpRemarkBuffer = std::move (*BufferOrErr);
429
430
431
+ // Don't try to parse the file if it's empty.
432
+ if (TmpRemarkBuffer->getBufferSize () == 0 )
433
+ return make_error<EndOfFileError>();
434
+
430
435
// Create a separate parser used for parsing the separate file.
431
436
ParserHelper = BitstreamParserHelper (TmpRemarkBuffer->getBuffer ());
432
437
// 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