diff options
author | Mike Pall <mike> | 2022-04-03 10:35:42 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2022-04-03 10:35:42 +0200 |
commit | 20aea93915a0d31138cb00e17cc15eb849e3b806 (patch) | |
tree | d23b96870347a92a3d47d44041b2e65fe7f57e08 /src | |
parent | 1cdff194cfa22cfe5bfc0e908b909e2dea40aa70 (diff) | |
download | luajit-20aea93915a0d31138cb00e17cc15eb849e3b806.tar.gz luajit-20aea93915a0d31138cb00e17cc15eb849e3b806.tar.bz2 luajit-20aea93915a0d31138cb00e17cc15eb849e3b806.zip |
Fix assertion for LJ_KEYINDEX.
Thanks to XmiliaH.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_obj.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h index 0a63fddf..fa7d02c2 100644 --- a/src/lj_obj.h +++ b/src/lj_obj.h | |||
@@ -845,6 +845,7 @@ static LJ_AINLINE void *lightudV(global_State *g, cTValue *o) | |||
845 | uint64_t seg = lightudseg(u); | 845 | uint64_t seg = lightudseg(u); |
846 | uint32_t *segmap = mref(g->gc.lightudseg, uint32_t); | 846 | uint32_t *segmap = mref(g->gc.lightudseg, uint32_t); |
847 | lj_assertG(tvislightud(o), "lightuserdata expected"); | 847 | lj_assertG(tvislightud(o), "lightuserdata expected"); |
848 | if (seg == (1 << LJ_LIGHTUD_BITS_SEG)-1) return NULL; | ||
848 | lj_assertG(seg <= g->gc.lightudnum, "bad lightuserdata segment %d", seg); | 849 | lj_assertG(seg <= g->gc.lightudnum, "bad lightuserdata segment %d", seg); |
849 | return (void *)(((uint64_t)segmap[seg] << 32) | lightudlo(u)); | 850 | return (void *)(((uint64_t)segmap[seg] << 32) | lightudlo(u)); |
850 | } | 851 | } |