We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
JS_ReadString
1 parent f62b90d commit 56593f4Copy full SHA for 56593f4
quickjs.c
@@ -33614,7 +33614,13 @@ static JSString *JS_ReadString(BCReaderState *s)
33614
}
33615
memcpy(p->u.str8, s->ptr, size);
33616
s->ptr += size;
33617
- if (!is_wide_char) {
+ if (is_wide_char) {
33618
+ if (is_be()) {
33619
+ uint32_t i;
33620
+ for (i = 0; i < len; i++)
33621
+ p->u.str16[i] = bswap16(p->u.str16[i]);
33622
+ }
33623
+ } else {
33624
p->u.str8[size] = '\0'; /* add the trailing zero for 8 bit strings */
33625
33626
#ifdef DUMP_READ_OBJECT
0 commit comments