diff options
| author | Michael Matz <matz@suse.de> | 2016-07-11 16:42:18 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:08 +0100 |
| commit | bbce31552ec7a9f4ac8a92f31d95d4a4c1be66d0 (patch) | |
| tree | 2577638dfaa03734355b58946963e929ea06b7be /tccasm.c | |
| parent | f9423ff3fa5ac2374ed1a36c2d93475539f63f35 (diff) | |
| download | tinycc-bbce31552ec7a9f4ac8a92f31d95d4a4c1be66d0.tar.gz tinycc-bbce31552ec7a9f4ac8a92f31d95d4a4c1be66d0.tar.bz2 | |
inline asm: accept concatenated strings in constraints
This really should be handled implicitly in the preprocessor,
but for now this is enough.
Diffstat (limited to 'tccasm.c')
| -rw-r--r-- | tccasm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1079,6 +1079,7 @@ static void parse_asm_operands(ASMOperand *operands, int *nb_operands_ptr, if (tok != ':') { nb_operands = *nb_operands_ptr; for(;;) { + CString astr; if (nb_operands >= MAX_ASM_OPERANDS) tcc_error("too many asm operands"); op = &operands[nb_operands++]; @@ -1091,11 +1092,10 @@ static void parse_asm_operands(ASMOperand *operands, int *nb_operands_ptr, next(); skip(']'); } - if (tok != TOK_STR) - expect("string constant"); - op->constraint = tcc_malloc(tokc.str.size); - strcpy(op->constraint, tokc.str.data); - next(); + parse_mult_str(&astr, "string constant"); + op->constraint = tcc_malloc(astr.size); + strcpy(op->constraint, astr.data); + cstr_free(&astr); skip('('); gexpr(); if (is_output) { |
