Karsten Hopp 52e1e8
To: vim_dev@googlegroups.com
Karsten Hopp 52e1e8
Subject: Patch 7.3.1077
Karsten Hopp 52e1e8
Fcc: outbox
Karsten Hopp 52e1e8
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 52e1e8
Mime-Version: 1.0
Karsten Hopp 52e1e8
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 52e1e8
Content-Transfer-Encoding: 8bit
Karsten Hopp 52e1e8
------------
Karsten Hopp 52e1e8
Karsten Hopp 52e1e8
Patch 7.3.1077
Karsten Hopp 52e1e8
Problem:    Python: Allocating dict the wrong way, causing a crash.
Karsten Hopp 52e1e8
Solution:   Use py_dict_alloc(). Fix some exception problems. (ZyX)
Karsten Hopp 52e1e8
Files:	    src/if_py_both.h
Karsten Hopp 52e1e8
Karsten Hopp 52e1e8
Karsten Hopp 52e1e8
*** ../vim-7.3.1076/src/if_py_both.h	2013-05-30 19:01:20.000000000 +0200
Karsten Hopp 52e1e8
--- src/if_py_both.h	2013-05-30 21:53:00.000000000 +0200
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 26,56 ****
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
Karsten Hopp 52e1e8
  #define INVALID_WINDOW_VALUE ((win_T *)(-1))
Karsten Hopp 52e1e8
  #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1))
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
- #define DICTKEY_DECL \
Karsten Hopp 52e1e8
-     PyObject	*dictkey_todecref = NULL;
Karsten Hopp 52e1e8
- #define DICTKEY_GET(err, decref) \
Karsten Hopp 52e1e8
-     if (!(key = StringToChars(keyObject, &dictkey_todecref))) \
Karsten Hopp 52e1e8
-     { \
Karsten Hopp 52e1e8
- 	if (decref) \
Karsten Hopp 52e1e8
- 	{ \
Karsten Hopp 52e1e8
- 	    Py_DECREF(keyObject); \
Karsten Hopp 52e1e8
- 	} \
Karsten Hopp 52e1e8
- 	return err; \
Karsten Hopp 52e1e8
-     } \
Karsten Hopp 52e1e8
-     if (decref && !dictkey_todecref) \
Karsten Hopp 52e1e8
- 	dictkey_todecref = keyObject; \
Karsten Hopp 52e1e8
-     if (*key == NUL) \
Karsten Hopp 52e1e8
-     { \
Karsten Hopp 52e1e8
- 	PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
Karsten Hopp 52e1e8
- 	return err; \
Karsten Hopp 52e1e8
-     }
Karsten Hopp 52e1e8
- #define DICTKEY_UNREF \
Karsten Hopp 52e1e8
-     Py_XDECREF(dictkey_todecref);
Karsten Hopp 52e1e8
- 
Karsten Hopp 52e1e8
  typedef void (*rangeinitializer)(void *);
Karsten Hopp 52e1e8
  typedef void (*runner)(const char *, void *
Karsten Hopp 52e1e8
  #ifdef PY_CAN_RECURSE
Karsten Hopp 52e1e8
--- 26,38 ----
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
+ #define RAISE_NO_EMPTY_KEYS PyErr_SetString(PyExc_ValueError, \
Karsten Hopp 52e1e8
+ 						_("empty keys are not allowed"))
Karsten Hopp 52e1e8
+ 
Karsten Hopp 52e1e8
  #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
Karsten Hopp 52e1e8
  #define INVALID_WINDOW_VALUE ((win_T *)(-1))
Karsten Hopp 52e1e8
  #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1))
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  typedef void (*rangeinitializer)(void *);
Karsten Hopp 52e1e8
  typedef void (*runner)(const char *, void *
Karsten Hopp 52e1e8
  #ifdef PY_CAN_RECURSE
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1016,1023 ****
Karsten Hopp 52e1e8
      dictitem_T	*di;
Karsten Hopp 52e1e8
      dict_T	*dict = self->dict;
Karsten Hopp 52e1e8
      hashitem_T	*hi;
Karsten Hopp 52e1e8
! 
Karsten Hopp 52e1e8
!     DICTKEY_DECL
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (flags & DICT_FLAG_HAS_DEFAULT)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
--- 998,1004 ----
Karsten Hopp 52e1e8
      dictitem_T	*di;
Karsten Hopp 52e1e8
      dict_T	*dict = self->dict;
Karsten Hopp 52e1e8
      hashitem_T	*hi;
Karsten Hopp 52e1e8
!     PyObject	*todecref;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (flags & DICT_FLAG_HAS_DEFAULT)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1030,1040 ****
Karsten Hopp 52e1e8
      if (flags & DICT_FLAG_RETURN_BOOL)
Karsten Hopp 52e1e8
  	defObject = Py_False;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_GET(NULL, 0)
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      hi = hash_find(&dict->dv_hashtab, key);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_UNREF
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (HASHITEM_EMPTY(hi))
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
--- 1011,1028 ----
Karsten Hopp 52e1e8
      if (flags & DICT_FLAG_RETURN_BOOL)
Karsten Hopp 52e1e8
  	defObject = Py_False;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(key = StringToChars(keyObject, &todecref)))
Karsten Hopp 52e1e8
! 	return NULL;
Karsten Hopp 52e1e8
! 
Karsten Hopp 52e1e8
!     if (*key == NUL)
Karsten Hopp 52e1e8
!     {
Karsten Hopp 52e1e8
! 	RAISE_NO_EMPTY_KEYS;
Karsten Hopp 52e1e8
! 	return NULL;
Karsten Hopp 52e1e8
!     }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      hi = hash_find(&dict->dv_hashtab, key);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (HASHITEM_EMPTY(hi))
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1173,1179 ****
Karsten Hopp 52e1e8
      typval_T	tv;
Karsten Hopp 52e1e8
      dict_T	*dict = self->dict;
Karsten Hopp 52e1e8
      dictitem_T	*di;
Karsten Hopp 52e1e8
!     DICTKEY_DECL
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (dict->dv_lock)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
--- 1161,1167 ----
Karsten Hopp 52e1e8
      typval_T	tv;
Karsten Hopp 52e1e8
      dict_T	*dict = self->dict;
Karsten Hopp 52e1e8
      dictitem_T	*di;
Karsten Hopp 52e1e8
!     PyObject	*todecref;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (dict->dv_lock)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1181,1187 ****
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_GET(-1, 0)
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      di = dict_find(dict, key, -1);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
--- 1169,1181 ----
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(key = StringToChars(keyObject, &todecref)))
Karsten Hopp 52e1e8
! 	return -1;
Karsten Hopp 52e1e8
!     if (*key == NUL)
Karsten Hopp 52e1e8
!     {
Karsten Hopp 52e1e8
! 	RAISE_NO_EMPTY_KEYS;
Karsten Hopp 52e1e8
! 	return -1;
Karsten Hopp 52e1e8
!     }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      di = dict_find(dict, key, -1);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1191,1197 ****
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  	if (di == NULL)
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
! 	    DICTKEY_UNREF
Karsten Hopp 52e1e8
  	    PyErr_SetObject(PyExc_KeyError, keyObject);
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
--- 1185,1191 ----
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  	if (di == NULL)
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
! 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    PyErr_SetObject(PyExc_KeyError, keyObject);
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1208,1213 ****
Karsten Hopp 52e1e8
--- 1202,1208 ----
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
  	if (!(di = dictitem_alloc(key)))
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
+ 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    PyErr_NoMemory();
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1216,1222 ****
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  	if (dict_add(dict, di) == FAIL)
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
! 	    DICTKEY_UNREF
Karsten Hopp 52e1e8
  	    vim_free(di);
Karsten Hopp 52e1e8
  	    dictitem_free(di);
Karsten Hopp 52e1e8
  	    PyErr_SetVim(_("failed to add key to dictionary"));
Karsten Hopp 52e1e8
--- 1211,1217 ----
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
  	if (dict_add(dict, di) == FAIL)
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
! 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    vim_free(di);
Karsten Hopp 52e1e8
  	    dictitem_free(di);
Karsten Hopp 52e1e8
  	    PyErr_SetVim(_("failed to add key to dictionary"));
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 1226,1232 ****
Karsten Hopp 52e1e8
      else
Karsten Hopp 52e1e8
  	clear_tv(&di->di_tv);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_UNREF
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      copy_tv(&tv, &di->di_tv);
Karsten Hopp 52e1e8
      clear_tv(&tv;;
Karsten Hopp 52e1e8
--- 1221,1227 ----
Karsten Hopp 52e1e8
      else
Karsten Hopp 52e1e8
  	clear_tv(&di->di_tv);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      copy_tv(&tv, &di->di_tv);
Karsten Hopp 52e1e8
      clear_tv(&tv;;
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 2202,2218 ****
Karsten Hopp 52e1e8
      int		flags;
Karsten Hopp 52e1e8
      long	numval;
Karsten Hopp 52e1e8
      char_u	*stringval;
Karsten Hopp 52e1e8
!     DICTKEY_DECL
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (self->Check(self->from))
Karsten Hopp 52e1e8
  	return NULL;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_GET(NULL, 0)
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      flags = get_option_value_strict(key, &numval, &stringval,
Karsten Hopp 52e1e8
  				    self->opt_type, self->from);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_UNREF
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (flags == 0)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
--- 2197,2219 ----
Karsten Hopp 52e1e8
      int		flags;
Karsten Hopp 52e1e8
      long	numval;
Karsten Hopp 52e1e8
      char_u	*stringval;
Karsten Hopp 52e1e8
!     PyObject	*todecref;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (self->Check(self->from))
Karsten Hopp 52e1e8
  	return NULL;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(key = StringToChars(keyObject, &todecref)))
Karsten Hopp 52e1e8
! 	return NULL;
Karsten Hopp 52e1e8
!     if (*key == NUL)
Karsten Hopp 52e1e8
!     {
Karsten Hopp 52e1e8
! 	RAISE_NO_EMPTY_KEYS;
Karsten Hopp 52e1e8
! 	return NULL;
Karsten Hopp 52e1e8
!     }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      flags = get_option_value_strict(key, &numval, &stringval,
Karsten Hopp 52e1e8
  				    self->opt_type, self->from);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (flags == 0)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 2329,2340 ****
Karsten Hopp 52e1e8
      int		flags;
Karsten Hopp 52e1e8
      int		opt_flags;
Karsten Hopp 52e1e8
      int		r = 0;
Karsten Hopp 52e1e8
!     DICTKEY_DECL
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (self->Check(self->from))
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_GET(-1, 0)
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      flags = get_option_value_strict(key, NULL, NULL,
Karsten Hopp 52e1e8
  				    self->opt_type, self->from);
Karsten Hopp 52e1e8
--- 2330,2347 ----
Karsten Hopp 52e1e8
      int		flags;
Karsten Hopp 52e1e8
      int		opt_flags;
Karsten Hopp 52e1e8
      int		r = 0;
Karsten Hopp 52e1e8
!     PyObject	*todecref;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      if (self->Check(self->from))
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(key = StringToChars(keyObject, &todecref)))
Karsten Hopp 52e1e8
! 	return -1;
Karsten Hopp 52e1e8
!     if (*key == NUL)
Karsten Hopp 52e1e8
!     {
Karsten Hopp 52e1e8
! 	RAISE_NO_EMPTY_KEYS;
Karsten Hopp 52e1e8
! 	return -1;
Karsten Hopp 52e1e8
!     }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      flags = get_option_value_strict(key, NULL, NULL,
Karsten Hopp 52e1e8
  				    self->opt_type, self->from);
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 2342,2348 ****
Karsten Hopp 52e1e8
      if (flags == 0)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
  	PyErr_SetObject(PyExc_KeyError, keyObject);
Karsten Hopp 52e1e8
! 	DICTKEY_UNREF
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
--- 2349,2355 ----
Karsten Hopp 52e1e8
      if (flags == 0)
Karsten Hopp 52e1e8
      {
Karsten Hopp 52e1e8
  	PyErr_SetObject(PyExc_KeyError, keyObject);
Karsten Hopp 52e1e8
! 	Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 2352,2371 ****
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    PyErr_SetString(PyExc_ValueError,
Karsten Hopp 52e1e8
  		    _("unable to unset global option"));
Karsten Hopp 52e1e8
! 	    DICTKEY_UNREF
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  	else if (!(flags & SOPT_GLOBAL))
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    PyErr_SetString(PyExc_ValueError, _("unable to unset option "
Karsten Hopp 52e1e8
  						"without global value"));
Karsten Hopp 52e1e8
! 	    DICTKEY_UNREF
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  	else
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    unset_global_local_option(key, self->from);
Karsten Hopp 52e1e8
! 	    DICTKEY_UNREF
Karsten Hopp 52e1e8
  	    return 0;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
--- 2359,2378 ----
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    PyErr_SetString(PyExc_ValueError,
Karsten Hopp 52e1e8
  		    _("unable to unset global option"));
Karsten Hopp 52e1e8
! 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  	else if (!(flags & SOPT_GLOBAL))
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    PyErr_SetString(PyExc_ValueError, _("unable to unset option "
Karsten Hopp 52e1e8
  						"without global value"));
Karsten Hopp 52e1e8
! 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  	else
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    unset_global_local_option(key, self->from);
Karsten Hopp 52e1e8
! 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    return 0;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 2396,2402 ****
Karsten Hopp 52e1e8
  	else
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    PyErr_SetString(PyExc_TypeError, _("object must be integer"));
Karsten Hopp 52e1e8
! 	    DICTKEY_UNREF
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
--- 2403,2409 ----
Karsten Hopp 52e1e8
  	else
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    PyErr_SetString(PyExc_TypeError, _("object must be integer"));
Karsten Hopp 52e1e8
! 	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 2418,2424 ****
Karsten Hopp 52e1e8
  	    r = -1;
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     DICTKEY_UNREF
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      return r;
Karsten Hopp 52e1e8
  }
Karsten Hopp 52e1e8
--- 2425,2431 ----
Karsten Hopp 52e1e8
  	    r = -1;
Karsten Hopp 52e1e8
      }
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      return r;
Karsten Hopp 52e1e8
  }
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 4528,4534 ****
Karsten Hopp 52e1e8
      PyObject	*valObject;
Karsten Hopp 52e1e8
      Py_ssize_t	iter = 0;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(dict = dict_alloc()))
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      tv->v_type = VAR_DICT;
Karsten Hopp 52e1e8
--- 4535,4541 ----
Karsten Hopp 52e1e8
      PyObject	*valObject;
Karsten Hopp 52e1e8
      Py_ssize_t	iter = 0;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(dict = py_dict_alloc()))
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      tv->v_type = VAR_DICT;
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 4553,4558 ****
Karsten Hopp 52e1e8
--- 4560,4566 ----
Karsten Hopp 52e1e8
  	{
Karsten Hopp 52e1e8
  	    dict_unref(dict);
Karsten Hopp 52e1e8
  	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
+ 	    RAISE_NO_EMPTY_KEYS;
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 4600,4606 ****
Karsten Hopp 52e1e8
      PyObject	*keyObject;
Karsten Hopp 52e1e8
      PyObject	*valObject;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(dict = dict_alloc()))
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      tv->v_type = VAR_DICT;
Karsten Hopp 52e1e8
--- 4608,4614 ----
Karsten Hopp 52e1e8
      PyObject	*keyObject;
Karsten Hopp 52e1e8
      PyObject	*valObject;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
!     if (!(dict = py_dict_alloc()))
Karsten Hopp 52e1e8
  	return -1;
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
      tv->v_type = VAR_DICT;
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 4637,4642 ****
Karsten Hopp 52e1e8
--- 4645,4651 ----
Karsten Hopp 52e1e8
  	    Py_DECREF(iterator);
Karsten Hopp 52e1e8
  	    Py_XDECREF(todecref);
Karsten Hopp 52e1e8
  	    dict_unref(dict);
Karsten Hopp 52e1e8
+ 	    RAISE_NO_EMPTY_KEYS;
Karsten Hopp 52e1e8
  	    return -1;
Karsten Hopp 52e1e8
  	}
Karsten Hopp 52e1e8
  
Karsten Hopp 52e1e8
*** ../vim-7.3.1076/src/version.c	2013-05-30 21:42:09.000000000 +0200
Karsten Hopp 52e1e8
--- src/version.c	2013-05-30 21:49:50.000000000 +0200
Karsten Hopp 52e1e8
***************
Karsten Hopp 52e1e8
*** 730,731 ****
Karsten Hopp 52e1e8
--- 730,733 ----
Karsten Hopp 52e1e8
  {   /* Add new patch number below this line */
Karsten Hopp 52e1e8
+ /**/
Karsten Hopp 52e1e8
+     1077,
Karsten Hopp 52e1e8
  /**/
Karsten Hopp 52e1e8
Karsten Hopp 52e1e8
-- 
Karsten Hopp 52e1e8
The History of every major Galactic Civilization tends to pass through
Karsten Hopp 52e1e8
three distinct and recognizable phases, those of Survival, Inquiry and
Karsten Hopp 52e1e8
Sophistication, otherwise known as the How, Why and Where phases.
Karsten Hopp 52e1e8
For instance, the first phase is characterized by the question 'How can
Karsten Hopp 52e1e8
we eat?' the second by the question 'Why do we eat?' and the third by
Karsten Hopp 52e1e8
the question 'Where shall we have lunch?'
Karsten Hopp 52e1e8
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
Karsten Hopp 52e1e8
Karsten Hopp 52e1e8
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 52e1e8
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 52e1e8
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 52e1e8
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///