diff options
| author | Andrew Chambers <[email protected]> | 2021-10-13 11:40:59 +1300 |
|---|---|---|
| committer | Andrew Chambers <[email protected]> | 2021-10-13 11:40:59 +1300 |
| commit | e6326541162130dd4c2121db14c298cd5ad2009c (patch) | |
| tree | 36693b45d78df0b2551511bdd08f7ab847c035a0 /asm.peg | |
| parent | 4fc6bfe524c3f708111e4659627d474d73f3352d (diff) | |
Simple string interning.
Diffstat (limited to 'asm.peg')
| -rw-r--r-- | asm.peg | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -53,8 +53,8 @@ section-directive = {$$.section = (DirSection){.kind=ASM_DIR_SECTION, .name=n.charptr, .flags="", .type=SHT_PROGBITS}; } ) -section-name = <[.a-zA-Z0-9\-]+> { $$.charptr = xstrdup(yytext); } -section-flags = '"' <[awx]*> '"' { $$.charptr = xstrdup(yytext); } +section-name = <[.a-zA-Z0-9\-]+> { $$.charptr = internstring(yytext); } +section-flags = '"' <[awx]*> '"' { $$.charptr = internstring(yytext); } section-type = "@nobits" { $$.i64 = SHT_NOBITS; } | "@progbits" { $$.i64 = SHT_PROGBITS; } @@ -589,7 +589,7 @@ value = ident = <[._a-zA-Z][._a-zA-Z0-9]*> - { $$.charptr = xstrdup(yytext); } + { $$.charptr = internstring(yytext); } number = '-' ws? n:unsigned-number |
