Fix STRSLICE with no stop index argument (#1682)

This commit is contained in:
Rangi
2025-05-04 16:56:25 -04:00
committed by GitHub
parent 1715f85d50
commit e1ae92709c
2 changed files with 4 additions and 4 deletions

View File

@@ -1623,7 +1623,7 @@ string_literal:
| OP_STRSLICE LPAREN string COMMA iconst RPAREN {
size_t len = strlenUTF8($3, false);
uint32_t start = adjustNegativeIndex($5, len, "STRSLICE");
$$ = strsliceUTF8($3, start, len - 1);
$$ = strsliceUTF8($3, start, len);
}
| OP_STRSUB LPAREN string COMMA iconst COMMA uconst RPAREN {
size_t len = strlenUTF8($3, false);