[PATCH] Fix a crash that occurs when PWD is invalid.

Andrew Trick atrick at apple.com
Mon Dec 9 11:41:54 PST 2013


MCJIT needs to be able to run in hostile environments, even when PWD
is invalid. There's no need to crash MCJIT in this case.

If we do want to guarantee valid CompilationDir, that should be done
only for clients of getCompilationDir(). This is as simple as checking
for an empty string.

The obvious fix is to simply leave MCContext's CompilationDir empty
when PWD can't be determined. The only behavioral difference would be
that EmitGenDwarfInfo would output an empty string when recording the
working dir for the assembly output.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-a-crash-that-occurs-when-PWD-is-invalid.patch
Type: application/octet-stream
Size: 2150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131209/fdabc600/attachment.obj>


More information about the llvm-commits mailing list