aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-06 16:20:28 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-06 16:20:28 -0200
commit348fa1ca56efeb81ef66d8f09c3cd1405b0a121d (patch)
tree0becf006d4f2afc51ce0e040182b16444e7f47db
parentae11e37e53be81f1d1eb21dde02dd26d6a21c194 (diff)
downloadlua-348fa1ca56efeb81ef66d8f09c3cd1405b0a121d.tar.gz
lua-348fa1ca56efeb81ef66d8f09c3cd1405b0a121d.tar.bz2
lua-348fa1ca56efeb81ef66d8f09c3cd1405b0a121d.zip
bug: 'lua_pushcclosure' should not call the garbage collector when
'n' is zero.
-rw-r--r--bugs37
1 files changed, 35 insertions, 2 deletions
diff --git a/bugs b/bugs
index f3caeec2..bd4b313c 100644
--- a/bugs
+++ b/bugs
@@ -3680,9 +3680,9 @@ It needs an "interceptor" 'memcmp' function that continues
3680reading memory after a difference is found.]], 3680reading memory after a difference is found.]],
3681patch = [[ 3681patch = [[
36822c2 36822c2
3683< ** $Id: bugs,v 1.156 2017/08/12 13:12:42 roberto Exp roberto $ 3683< ** $Id: bugs,v 1.157 2017/08/31 16:14:41 roberto Exp roberto $
3684--- 3684---
3685> ** $Id: bugs,v 1.156 2017/08/12 13:12:42 roberto Exp roberto $ 3685> ** $Id: bugs,v 1.157 2017/08/31 16:14:41 roberto Exp roberto $
3686263c263,264 3686263c263,264
3687< for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) { 3687< for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) {
3688--- 3688---
@@ -3871,6 +3871,39 @@ patch = [[
3871} 3871}
3872 3872
3873 3873
3874Bug{
3875what = [['lua_pushcclosure' should not call the garbage collector when
3876'n' is zero.]],
3877report = [[Andrew Gierth, 2017/12/05]],
3878since = [[5.3.3]],
3879fix = nil,
3880example = [[ ]],
3881patch = [[
3882--- lapi.c 2017/04/19 17:13:00 2.259.1.1
3883+++ lapi.c 2017/12/06 18:14:45
3884@@ -533,6 +533,7 @@
3885 lua_lock(L);
3886 if (n == 0) {
3887 setfvalue(L->top, fn);
3888+ api_incr_top(L);
3889 }
3890 else {
3891 CClosure *cl;
3892@@ -546,9 +547,9 @@
3893 /* does not need barrier because closure is white */
3894 }
3895 setclCvalue(L, L->top, cl);
3896+ api_incr_top(L);
3897+ luaC_checkGC(L);
3898 }
3899- api_incr_top(L);
3900- luaC_checkGC(L);
3901 lua_unlock(L);
3902 }
3903]]
3904}
3905
3906
3874 3907
3875 3908
3876--[=[ 3909--[=[