Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
477116f7
Unverified
Commit
477116f7
authored
Mar 26, 2018
by
Terry Ellison
Committed by
GitHub
Mar 26, 2018
Browse files
Merge pull request #2320 from TerryE/devLuaStackFix
Fix Lua stack corruption problem
parents
519d6df6
d78c54ac
Changes
1
Show whitespace changes
Inline
Side-by-side
app/lua/ldo.c
View file @
477116f7
...
@@ -144,8 +144,11 @@ static void correctstack (lua_State *L, TValue *oldstack) {
...
@@ -144,8 +144,11 @@ static void correctstack (lua_State *L, TValue *oldstack) {
void
luaD_reallocstack
(
lua_State
*
L
,
int
newsize
)
{
void
luaD_reallocstack
(
lua_State
*
L
,
int
newsize
)
{
TValue
*
oldstack
=
L
->
stack
;
TValue
*
oldstack
=
L
->
stack
;
int
realsize
=
newsize
+
1
+
EXTRA_STACK
;
int
realsize
=
newsize
+
1
+
EXTRA_STACK
;
int
block_status
=
is_block_gc
(
L
);
lua_assert
(
L
->
stack_last
-
L
->
stack
==
L
->
stacksize
-
EXTRA_STACK
-
1
);
lua_assert
(
L
->
stack_last
-
L
->
stack
==
L
->
stacksize
-
EXTRA_STACK
-
1
);
set_block_gc
(
L
);
/* The GC MUST be blocked during stack reallocaiton */
luaM_reallocvector
(
L
,
L
->
stack
,
L
->
stacksize
,
realsize
,
TValue
);
luaM_reallocvector
(
L
,
L
->
stack
,
L
->
stacksize
,
realsize
,
TValue
);
if
(
!
block_status
)
unset_block_gc
(
L
);
/* Honour the previous block status */
L
->
stacksize
=
realsize
;
L
->
stacksize
=
realsize
;
L
->
stack_last
=
L
->
stack
+
newsize
;
L
->
stack_last
=
L
->
stack
+
newsize
;
correctstack
(
L
,
oldstack
);
correctstack
(
L
,
oldstack
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment