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
3f5ae99e
Unverified
Commit
3f5ae99e
authored
Mar 24, 2019
by
Terry Ellison
Committed by
GitHub
Mar 24, 2019
Browse files
Fix unaligned load/store exception in luaR_findentry (#2702)
parent
a90de79c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/lua/lrotable.c
View file @
3f5ae99e
...
...
@@ -86,6 +86,7 @@ const TValue* luaR_findentry(ROTable *rotable, TString *key, unsigned *ppos) {
size_t
hash
=
HASH
(
rotable
,
key
);
unsigned
i
=
0
;
int
j
=
lookup_cache
(
hash
,
rotable
);
unsigned
l
=
key
?
key
->
tsv
.
len
:
sizeof
(
"__metatable"
)
-
1
;
if
(
pentry
)
{
if
(
j
>=
0
){
...
...
@@ -101,9 +102,9 @@ const TValue* luaR_findentry(ROTable *rotable, TString *key, unsigned *ppos) {
* aren't needed if there is a cache hit. Note that the termination null
* is included so a "on\0" has a mask of 0xFFFFFF and "a\0" has 0xFFFF.
*/
unsigned
name4
=
*
(
unsigned
*
)
strkey
;
unsigned
l
=
key
?
key
->
tsv
.
len
:
sizeof
(
"__metatable"
)
-
1
;
unsigned
mask4
=
l
>
2
?
(
~
0u
)
:
(
~
0u
)
>>
((
3
-
l
)
*
8
);
unsigned
name4
,
mask4
=
l
>
2
?
(
~
0u
)
:
(
~
0u
)
>>
((
3
-
l
)
*
8
)
;
c_memcpy
(
&
name4
,
strkey
,
sizeof
(
name4
))
;
for
(;
pentry
->
key
.
type
!=
LUA_TNIL
;
i
++
,
pentry
++
)
{
if
((
pentry
->
key
.
type
==
LUA_TSTRING
)
&&
((
*
(
unsigned
*
)
pentry
->
key
.
id
.
strkey
^
name4
)
&
mask4
)
==
0
&&
...
...
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