PATCH: Fix MemoryBufferMMapFile error reporting

Kim Gräsman kim.grasman at gmail.com
Fri Dec 12 12:36:31 PST 2014


Hello,

I stumbled over a bug in MemoryBufferMMapFile, where it fails to
report errors from its constructor.

Attached patch changes the EC argument of its constructor to be passed
by-ref, which matches what its client (getOpenFileImpl) expects.

I've experimented with test cases to reproduce this, but I haven't
found any clear-cut ways to do it (it's hidden behind too many
incidental details). I've attached my last attempt, but it closes the
global stdin fd as a side-effect, so it's no good.

For what it's worth,
- Kim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memorybuffer-error.patch
Type: application/octet-stream
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141212/02ba7d57/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memorybuffer-test.patch
Type: application/octet-stream
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141212/02ba7d57/attachment-0001.obj>


More information about the llvm-commits mailing list