Skip to content
Commit 9d53db2a authored by Fangrui Song's avatar Fangrui Song
Browse files

[Support] Allow FileOutputBuffer::create to create an empty file

Size==0 triggers `assert(Size != 0)` in mapped_file_region::init.
I plan to use an empty file in D79339 (llvm-objcopy --dump-section).

According to POSIX, "If len is zero, mmap() shall fail and no mapping
shall be established." Just specialize case Size=0 to use
createInMemoryBuffer.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D79338
parent 47f50665
Loading
Loading
Loading
Loading
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