Skip to content

Commit 5456f3d

Browse files
committed
Add one patch for Lua 5.5.0
1 parent 2ed5cf1 commit 5456f3d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

hererocks.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,18 @@ class RioLua(Lua):
20002000
} while (testnext(ls, ',') || testnext(ls, ';'));
20012001
check_match(ls, '}', '{', line);
20022002
lastlistfield(fs, &cc);
2003+
""",
2004+
"Arithmetic overflow in 'collectgarbage\"step\"'": """
2005+
lapi.c:
2006+
@@ -1205,6 +1205,8 @@ LUA_API int lua_gc (lua_State *L, int what, ...) {
2007+
g->gcstp = 0; /* allow GC to run (other bits must be zero here) */
2008+
if (n <= 0)
2009+
n = g->GCdebt; /* force to run one basic step */
2010+
+ else if (g->GCdebt < n - MAX_LMEM) /* overflow? */
2011+
+ n = MAX_LMEM + g->GCdebt; /* trim 'n' (debt must be negative) */
2012+
luaE_setdebt(g, g->GCdebt - n);
2013+
luaC_condGC(L, (void)0, work = 1);
2014+
if (work && g->gcstate == GCSpause) /* end of cycle? */
20032015
"""
20042016
}
20052017
patches_per_version = {
@@ -2077,6 +2089,11 @@ class RioLua(Lua):
20772089
"Constructors with nils can overflow counters during parsing"
20782090
]
20792091
},
2092+
"5.5": {
2093+
"0": [
2094+
"Arithmetic overflow in 'collectgarbage\"step\"'"
2095+
]
2096+
},
20802097
}
20812098

20822099
def __init__(self, version):

0 commit comments

Comments
 (0)