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
99cd2177
Commit
99cd2177
authored
Sep 04, 2016
by
Philip Gladstone
Committed by
Johny Mattsson
Sep 05, 2016
Browse files
Make struct.unpack wrapped in setlist actually work (#1486)
Fixes #1434.
parent
be263dac
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/lua/lvm.c
View file @
99cd2177
...
@@ -759,7 +759,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
...
@@ -759,7 +759,6 @@ void luaV_execute (lua_State *L, int nexeccalls) {
fixedstack
(
L
);
fixedstack
(
L
);
if
(
n
==
0
)
{
if
(
n
==
0
)
{
n
=
cast_int
(
L
->
top
-
ra
)
-
1
;
n
=
cast_int
(
L
->
top
-
ra
)
-
1
;
L
->
top
=
L
->
ci
->
top
;
}
}
if
(
c
==
0
)
c
=
cast_int
(
*
pc
++
);
if
(
c
==
0
)
c
=
cast_int
(
*
pc
++
);
runtime_check
(
L
,
ttistable
(
ra
));
runtime_check
(
L
,
ttistable
(
ra
));
...
@@ -772,6 +771,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
...
@@ -772,6 +771,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
setobj2t
(
L
,
luaH_setnum
(
L
,
h
,
last
--
),
val
);
setobj2t
(
L
,
luaH_setnum
(
L
,
h
,
last
--
),
val
);
luaC_barriert
(
L
,
h
,
val
);
luaC_barriert
(
L
,
h
,
val
);
}
}
L
->
top
=
L
->
ci
->
top
;
unfixedstack
(
L
);
unfixedstack
(
L
);
continue
;
continue
;
}
}
...
...
app/modules/struct.c
View file @
99cd2177
...
@@ -309,7 +309,7 @@ static int b_unpack (lua_State *L) {
...
@@ -309,7 +309,7 @@ static int b_unpack (lua_State *L) {
size_t
size
=
optsize
(
L
,
opt
,
&
fmt
);
size_t
size
=
optsize
(
L
,
opt
,
&
fmt
);
pos
+=
gettoalign
(
pos
,
&
h
,
opt
,
size
);
pos
+=
gettoalign
(
pos
,
&
h
,
opt
,
size
);
luaL_argcheck
(
L
,
pos
+
size
<=
ld
,
2
,
"data string too short"
);
luaL_argcheck
(
L
,
pos
+
size
<=
ld
,
2
,
"data string too short"
);
luaL_checkstack
(
L
,
1
,
"too many results"
);
luaL_checkstack
(
L
,
2
,
"too many results"
);
switch
(
opt
)
{
switch
(
opt
)
{
case
'b'
:
case
'B'
:
case
'h'
:
case
'H'
:
case
'b'
:
case
'B'
:
case
'h'
:
case
'H'
:
case
'l'
:
case
'L'
:
case
'T'
:
case
'i'
:
case
'I'
:
{
/* integer types */
case
'l'
:
case
'L'
:
case
'T'
:
case
'i'
:
case
'I'
:
{
/* integer types */
...
...
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