From 07f35424f1f25be0384d6d3d047149243ae3f42e Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 27 Oct 2008 17:42:38 +0100 Subject: [PATCH] Fix debug path. --- gen/todebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 65f29570..de5bdfa2 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -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");