mirror of
https://github.com/yasm/yasm
synced 2026-08-26 22:26:05 -04:00
Fix escaping at end of gas string constant.
Patch by: Daniel Diaz <Daniel.Diaz@univ-paris1.fr>
This commit is contained in:
parent
3bf0ed3927
commit
b96cc7d9b2
4 changed files with 10 additions and 3 deletions
|
|
@ -523,8 +523,8 @@ stringconst_scan:
|
|||
SCANINIT();
|
||||
|
||||
/*!re2c
|
||||
/* Handle escaped double-quote by copying and continuing */
|
||||
"\\\"" {
|
||||
/* Handle escaped character by copying both and continuing. */
|
||||
"\\". {
|
||||
if (cursor == s->eof) {
|
||||
yasm_error_set(YASM_ERROR_SYNTAX,
|
||||
N_("unexpected end of file in string"));
|
||||
|
|
@ -532,7 +532,8 @@ stringconst_scan:
|
|||
lvalp->str.len = count;
|
||||
RETURN(STRING);
|
||||
}
|
||||
strbuf_append(count++, cursor, s, '"');
|
||||
strbuf_append(count++, cursor, s, '\\');
|
||||
strbuf_append(count++, cursor, s, s->tok[1]);
|
||||
goto stringconst_scan;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ EXTRA_DIST += modules/parsers/gas/tests/bin/gas-macro.asm
|
|||
EXTRA_DIST += modules/parsers/gas/tests/bin/gas-macro.hex
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.asm
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/gas-set.hex
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/gas-str.asm
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/gas-str.hex
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/rept-err.asm
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/rept-err.errwarn
|
||||
EXTRA_DIST += modules/parsers/gas/tests/bin/reptempty.asm
|
||||
|
|
|
|||
1
modules/parsers/gas/tests/bin/gas-str.asm
Normal file
1
modules/parsers/gas/tests/bin/gas-str.asm
Normal file
|
|
@ -0,0 +1 @@
|
|||
.string "a\\"
|
||||
3
modules/parsers/gas/tests/bin/gas-str.hex
Normal file
3
modules/parsers/gas/tests/bin/gas-str.hex
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
61
|
||||
5c
|
||||
00
|
||||
Loading…
Add table
Add a link
Reference in a new issue