Skip to content

Commit b52695f

Browse files
committed
Parse UTF-32 string literal object
1 parent 6cfa473 commit b52695f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

msvc-demangler.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ export class Demangler {
6363
return sign * value;
6464
}
6565
parse_string_literal_name() {
66-
const wide = this.parse("string literal width")({
67-
'0': () => ({}),
68-
'1': () => ({ wide: 'wide' }),
66+
const stringkind = this.parse("string literal kind")({
67+
'0': () => ({ stringkind: 'narrow' }),
68+
'1': () => ({ stringkind: 'wide' }),
69+
'2': () => ({ stringkind: 'UTF-32' }),
6970
});
7071
const length = this.parse_integer();
7172
const crc = this.parse_source_name();
@@ -76,7 +77,7 @@ export class Demangler {
7677
str = str.replace(/\?[A-Z]/g, (m) => `\\x${hex(ord_diff(m[1], 'A') + 0xC1)}`);
7778
str = str.replace(/\?[0-9]/g, (m) => ",/\\:. \n\t'-"[ord_diff(m[1], '0')]);
7879
str = str.replace(/\?\$(..)/g, (m, p) => `\\x${p.replace(/./g, (s) => hex(ord_diff(s, 'A')))}`);
79-
return { namekind: 'string', ...wide, length, crc, content: str };
80+
return { namekind: 'string', ...stringkind, length, crc, content: str };
8081
}
8182
parse_template_name() {
8283
const [names_prev_active, types_prev_active] = [this.names.active, this.types.active];

0 commit comments

Comments
 (0)