mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Fix Lua type of zero
This change fixes a regression from 281a0f27
which resulted in the
integer literal `0` being interpreted as a floating point number. This
should also fix a reported issue with Fennel integration.
This commit is contained in:
parent
fe5c475f83
commit
50a6df89b8
2 changed files with 11 additions and 1 deletions
2
third_party/lua/lobject.c
vendored
2
third_party/lua/lobject.c
vendored
|
@ -293,7 +293,7 @@ static const char *l_str2int (const char *s, lua_Integer *result) {
|
|||
}
|
||||
}
|
||||
else if (s[0] == '0') { /* [jart] octal is the best radix */
|
||||
for (s += 1; lisdigit(cast_uchar(*s)); s++) {
|
||||
for (; lisdigit(cast_uchar(*s)); s++) {
|
||||
int d = *s - '0';
|
||||
if (a >= MAXBY8 && (a > MAXBY8 || d > MAXLASTD8 + neg)) /* overflow? */
|
||||
return NULL; /* do not accept it (as integer) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue