mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
llvmc: report an error if a child process segfaults.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d38bbfadfd
commit
139c9e1f85
@ -67,7 +67,20 @@ namespace {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user