[llvm-commits] [llvm] r104145 - /llvm/trunk/lib/CompilerDriver/Action.cpp
Mikhail Glushenkov
foldr at codedgers.com
Wed May 19 12:24:32 PDT 2010
Author: foldr
Date: Wed May 19 14:24:32 2010
New Revision: 104145
URL: http://llvm.org/viewvc/llvm-project?rev=104145&view=rev
Log:
llvmc: report an error if a child process segfaults.
Modified:
llvm/trunk/lib/CompilerDriver/Action.cpp
Modified: llvm/trunk/lib/CompilerDriver/Action.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CompilerDriver/Action.cpp?rev=104145&r1=104144&r2=104145&view=diff
==============================================================================
--- llvm/trunk/lib/CompilerDriver/Action.cpp (original)
+++ llvm/trunk/lib/CompilerDriver/Action.cpp Wed May 19 14:24:32 2010
@@ -67,7 +67,20 @@
argv.push_back(0); // null terminate list.
// Invoke the program.
- return sys::Program::ExecuteAndWait(prog, &argv[0], 0, &redirects[0]);
+ int ret = sys::Program::ExecuteAndWait(prog, &argv[0], 0, &redirects[0]);
+
+ if (ret < 0) {
+ const char** B = &argv[0];
+
+ errs() << "Segmentation fault:";
+ while (*B)
+ errs() << ' ' << *(B++);
+ errs() << '\n';
+
+ return 1;
+ }
+
+ return ret;
}
void print_string (const std::string& str) {
More information about the llvm-commits
mailing list