|
@@ -359,12 +359,12 @@ static int readhexaesc (LexState *ls) {
|
|
** for error reporting in case of errors; 'i' counts the number of
|
|
** for error reporting in case of errors; 'i' counts the number of
|
|
** saved characters, so that they can be removed if case of success.
|
|
** saved characters, so that they can be removed if case of success.
|
|
*/
|
|
*/
|
|
-static unsigned long readutf8esc (LexState *ls) {
|
|
|
|
- unsigned long r;
|
|
|
|
|
|
+static l_uint32 readutf8esc (LexState *ls) {
|
|
|
|
+ l_uint32 r;
|
|
int i = 4; /* number of chars to be removed: start with #"\u{X" */
|
|
int i = 4; /* number of chars to be removed: start with #"\u{X" */
|
|
save_and_next(ls); /* skip 'u' */
|
|
save_and_next(ls); /* skip 'u' */
|
|
esccheck(ls, ls->current == '{', "missing '{'");
|
|
esccheck(ls, ls->current == '{', "missing '{'");
|
|
- r = cast_ulong(gethexa(ls)); /* must have at least one digit */
|
|
|
|
|
|
+ r = cast_uint(gethexa(ls)); /* must have at least one digit */
|
|
while (cast_void(save_and_next(ls)), lisxdigit(ls->current)) {
|
|
while (cast_void(save_and_next(ls)), lisxdigit(ls->current)) {
|
|
i++;
|
|
i++;
|
|
esccheck(ls, r <= (0x7FFFFFFFu >> 4), "UTF-8 value too large");
|
|
esccheck(ls, r <= (0x7FFFFFFFu >> 4), "UTF-8 value too large");
|