diff options
author | Mike Pall <mike> | 2021-07-21 12:14:09 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2021-07-21 12:14:09 +0200 |
commit | 81a797373fa5364f7640b7f1668abada56a45d6b (patch) | |
tree | 1f41a9b2621db18577c0aeafe4e5c28b9e5e26eb /src/host | |
parent | 6ca580155b035fd369f193cdee59391b594a5028 (diff) | |
download | luajit-81a797373fa5364f7640b7f1668abada56a45d6b.tar.gz luajit-81a797373fa5364f7640b7f1668abada56a45d6b.tar.bz2 luajit-81a797373fa5364f7640b7f1668abada56a45d6b.zip |
Fix minilua vararg stack handling.
Note: this is not exploitable! minilua is only used during the LuaJIT
build process. It only runs controlled and static Lua code (DynASM),
which is entirely contained within this repo. LuaJIT itself has
completely different stack handling code and is not affected either.
This change is solely for the benefit of others, who might possibly use
minilua for purposes other than running DynASM.
Diffstat (limited to 'src/host')
-rw-r--r-- | src/host/minilua.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/minilua.c b/src/host/minilua.c index 79150286..cfc7491d 100644 --- a/src/host/minilua.c +++ b/src/host/minilua.c | |||
@@ -1134,7 +1134,7 @@ if(!cl->isC){ | |||
1134 | CallInfo*ci; | 1134 | CallInfo*ci; |
1135 | StkId st,base; | 1135 | StkId st,base; |
1136 | Proto*p=cl->p; | 1136 | Proto*p=cl->p; |
1137 | luaD_checkstack(L,p->maxstacksize); | 1137 | luaD_checkstack(L,p->maxstacksize+p->numparams); |
1138 | func=restorestack(L,funcr); | 1138 | func=restorestack(L,funcr); |
1139 | if(!p->is_vararg){ | 1139 | if(!p->is_vararg){ |
1140 | base=func+1; | 1140 | base=func+1; |