diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-06 16:20:28 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-06 16:20:28 -0200 |
| commit | 348fa1ca56efeb81ef66d8f09c3cd1405b0a121d (patch) | |
| tree | 0becf006d4f2afc51ce0e040182b16444e7f47db | |
| parent | ae11e37e53be81f1d1eb21dde02dd26d6a21c194 (diff) | |
| download | lua-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-- | bugs | 37 |
1 files changed, 35 insertions, 2 deletions
| @@ -3680,9 +3680,9 @@ It needs an "interceptor" 'memcmp' function that continues | |||
| 3680 | reading memory after a difference is found.]], | 3680 | reading memory after a difference is found.]], |
| 3681 | patch = [[ | 3681 | patch = [[ |
| 3682 | 2c2 | 3682 | 2c2 |
| 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 $ |
| 3686 | 263c263,264 | 3686 | 263c263,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 | ||
| 3874 | Bug{ | ||
| 3875 | what = [['lua_pushcclosure' should not call the garbage collector when | ||
| 3876 | 'n' is zero.]], | ||
| 3877 | report = [[Andrew Gierth, 2017/12/05]], | ||
| 3878 | since = [[5.3.3]], | ||
| 3879 | fix = nil, | ||
| 3880 | example = [[ ]], | ||
| 3881 | patch = [[ | ||
| 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 | --[=[ |
