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

Eric Christopher echristo at gmail.com
Mon Dec 9 20:38:25 PST 2013

> We’re not running into this case, nor do I think it is possible. However, I
> did hack an LLVM build to test this code path, and I think this is the patch
> you’re looking for:

I don't know what you mean by "not running into this case, nor do I
think it is possible" the statement doesn't make a lot of sense. You'd
basically have to pass the compilation dir in - right now if you want
to set it via clang's -fcompilation-dir= option it just modifies the
metadata. To do it in the backend you'd probably want a command line
option in MCContext.cpp.

I'm also quite concerned how you're running into this and that you're
not papering over a bug from somewhere else.

That said, this patch is obviously not too much of a hack around
functionality and should be fine. I'd have preferred the command line
option because then you could provide a way to test this workaround.



More information about the llvm-commits mailing list