diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-04 18:24:12 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-04 18:24:12 +0000 |
commit | a182afe5b90c9e4fb1cf3bbe8de65191ac84b205 (patch) | |
tree | c4fb345897bd620e336494f51d307d74a94f4b32 /clang-format | |
parent | 62c51d4248766d4a2a4ef518388b7a7ceb1438b0 (diff) |
Handle segfaults in clang-format vim-integration.
A segfault used to clear the entire buffer. With this change, a message
to report a bug is displayed instead.
This should solve most cases similar to llvm.org/PR14774.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@171480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-format')
-rw-r--r-- | clang-format/clang-format.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang-format/clang-format.py b/clang-format/clang-format.py index b674a764..a08990be 100644 --- a/clang-format/clang-format.py +++ b/clang-format/clang-format.py @@ -43,7 +43,9 @@ stdout, stderr = p.communicate(input=text) if stderr: print stderr else: - if stdout != text: + if not stdout: + print 'Segfault occurred. Please report to bugs.llvm.org.' + elif stdout != text: lines = stdout.split('\n') for i in range(min(len(buf), len(lines))): buf[i] = lines[i] |