Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.885
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.885
Problem:    Double free for list and dict in Lua. (Shougo Matsu)
Solution:   Do not unref list and dict. (Yasuhiro Matsumoto)
Files:	    src/if_lua.c


*** ../vim-7.3.884/src/if_lua.c	2013-02-14 22:19:47.000000000 +0100
--- src/if_lua.c	2013-04-12 11:42:56.000000000 +0200
***************
*** 665,677 ****
  luaV_type_tostring(list, LUAVIM_LIST)
  
      static int
- luaV_list_gc (lua_State *L)
- {
-     list_unref(luaV_unbox(L, luaV_List, 1));
-     return 0;
- }
- 
-     static int
  luaV_list_len (lua_State *L)
  {
      list_T *l = luaV_unbox(L, luaV_List, 1);
--- 665,670 ----
***************
*** 801,807 ****
  
  static const luaL_Reg luaV_List_mt[] = {
      {"__tostring", luaV_list_tostring},
-     {"__gc", luaV_list_gc},
      {"__len", luaV_list_len},
      {"__call", luaV_list_call},
      {"__index", luaV_list_index},
--- 794,799 ----
***************
*** 830,842 ****
  luaV_type_tostring(dict, LUAVIM_DICT)
  
      static int
- luaV_dict_gc (lua_State *L)
- {
-     dict_unref(luaV_unbox(L, luaV_Dict, 1));
-     return 0;
- }
- 
-     static int
  luaV_dict_len (lua_State *L)
  {
      dict_T *d = luaV_unbox(L, luaV_Dict, 1);
--- 822,827 ----
***************
*** 929,935 ****
  
  static const luaL_Reg luaV_Dict_mt[] = {
      {"__tostring", luaV_dict_tostring},
-     {"__gc", luaV_dict_gc},
      {"__len", luaV_dict_len},
      {"__call", luaV_dict_call},
      {"__index", luaV_dict_index},
--- 914,919 ----
*** ../vim-7.3.884/src/version.c	2013-04-06 14:30:35.000000000 +0200
--- src/version.c	2013-04-12 11:44:45.000000000 +0200
***************
*** 730,731 ****
--- 730,733 ----
  {   /* Add new patch number below this line */
+ /**/
+     885,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
148. You find it easier to dial-up the National Weather Service
     Weather/your_town/now.html than to simply look out the window.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///