jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone
3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.161
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.161
3ef2ca
Problem:    Crash in Python exception handling.
3ef2ca
Solution:   Only use exception variables if did_throw is set. (ZyX)
3ef2ca
Files:	    if_py_both.h
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.160/src/if_py_both.h	2014-01-14 19:35:49.000000000 +0100
3ef2ca
--- src/if_py_both.h	2014-01-31 14:46:20.455526607 +0100
3ef2ca
***************
3ef2ca
*** 564,573 ****
3ef2ca
      /* Keyboard interrupt should be preferred over anything else */
3ef2ca
      if (got_int)
3ef2ca
      {
3ef2ca
! 	if (current_exception != NULL)
3ef2ca
  	    discard_current_exception();
3ef2ca
- 	else
3ef2ca
- 	    need_rethrow = did_throw = FALSE;
3ef2ca
  	got_int = FALSE;
3ef2ca
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
3ef2ca
  	return -1;
3ef2ca
--- 564,571 ----
3ef2ca
      /* Keyboard interrupt should be preferred over anything else */
3ef2ca
      if (got_int)
3ef2ca
      {
3ef2ca
! 	if (did_throw)
3ef2ca
  	    discard_current_exception();
3ef2ca
  	got_int = FALSE;
3ef2ca
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
3ef2ca
  	return -1;
3ef2ca
***************
3ef2ca
*** 599,608 ****
3ef2ca
      /* Python exception is preferred over vim one; unlikely to occur though */
3ef2ca
      else if (PyErr_Occurred())
3ef2ca
      {
3ef2ca
! 	if (current_exception != NULL)
3ef2ca
! 	    discard_current_exception();
3ef2ca
! 	else
3ef2ca
! 	    need_rethrow = did_throw = FALSE;
3ef2ca
  	return -1;
3ef2ca
      }
3ef2ca
      /* Finally transform VimL exception to python one */
3ef2ca
--- 597,603 ----
3ef2ca
      /* Python exception is preferred over vim one; unlikely to occur though */
3ef2ca
      else if (PyErr_Occurred())
3ef2ca
      {
3ef2ca
! 	discard_current_exception();
3ef2ca
  	return -1;
3ef2ca
      }
3ef2ca
      /* Finally transform VimL exception to python one */
3ef2ca
*** ../vim-7.4.160/src/version.c	2014-01-24 19:55:33.078220735 +0100
3ef2ca
--- src/version.c	2014-01-31 14:46:39.127526894 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     161,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
Eagles may soar, but weasels don't get sucked into jet engines.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///