Author: djasper
Date: Fri Jan  4 12:24:12 2013
New Revision: 171480

URL: http://llvm.org/viewvc/llvm-project?rev=171480&view=rev
Log:
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.

Modified:
    clang-tools-extra/trunk/clang-format/clang-format.py

Modified: clang-tools-extra/trunk/clang-format/clang-format.py
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/clang-format.py?rev=171480&r1=171479&r2=171480&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-format/clang-format.py (original)
+++ clang-tools-extra/trunk/clang-format/clang-format.py Fri Jan  4 12:24:12 
2013
@@ -43,7 +43,9 @@
 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]


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to