Fix debug path.

This commit is contained in:
Christian Kamm
2008-10-27 17:42:38 +01:00
parent 6b9e85df48
commit 07f35424f1

View File

@@ -141,7 +141,7 @@ static LLGlobalVariable* dwarfCompileUnit(Module* m)
llvm::sys::Path tmp = llvm::sys::Path::GetCurrentDirectory();
tmp.appendComponent(srcpath);
srcpath = tmp.toString();
if (*srcpath.rbegin() != '/' || *srcpath.rbegin() != '\\')
if (!srcpath.empty() && *srcpath.rbegin() != '/' && *srcpath.rbegin() != '\\')
srcpath = srcpath + '/';
}
vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata");