diff options
author | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
commit | 1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0 (patch) | |
tree | 8bd3fbeb396fd2fce6e5b34c3ee10f4923feca72 /src/3rdParty/lua/lvm.c | |
parent | 05da3cbfa3689e6c229c41156d0dd08ab554cd77 (diff) | |
download | yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.gz yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.bz2 yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.zip |
Fixed issue #174.
Diffstat (limited to 'src/3rdParty/lua/lvm.c')
-rw-r--r-- | src/3rdParty/lua/lvm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/3rdParty/lua/lvm.c b/src/3rdParty/lua/lvm.c index 4d71cff..fcd24e1 100644 --- a/src/3rdParty/lua/lvm.c +++ b/src/3rdParty/lua/lvm.c | |||
@@ -92,7 +92,7 @@ static int l_strton (const TValue *obj, TValue *result) { | |||
92 | if (!cvt2num(obj)) /* is object not a string? */ | 92 | if (!cvt2num(obj)) /* is object not a string? */ |
93 | return 0; | 93 | return 0; |
94 | else { | 94 | else { |
95 | TString *st = tsvalue(obj); | 95 | TString *st = tsvalue(obj); |
96 | return (luaO_str2num(getstr(st), result) == tsslen(st) + 1); | 96 | return (luaO_str2num(getstr(st), result) == tsslen(st) + 1); |
97 | } | 97 | } |
98 | } | 98 | } |
@@ -661,7 +661,7 @@ void luaV_concat (lua_State *L, int total) { | |||
661 | /* collect total length and number of strings */ | 661 | /* collect total length and number of strings */ |
662 | for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) { | 662 | for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) { |
663 | size_t l = tsslen(tsvalue(s2v(top - n - 1))); | 663 | size_t l = tsslen(tsvalue(s2v(top - n - 1))); |
664 | if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) { | 664 | if (l_unlikely(l >= MAX_SIZE - sizeof(TString) - tl)) { |
665 | L->top.p = top - total; /* pop strings to avoid wasting stack */ | 665 | L->top.p = top - total; /* pop strings to avoid wasting stack */ |
666 | luaG_runerror(L, "string length overflow"); | 666 | luaG_runerror(L, "string length overflow"); |
667 | } | 667 | } |