Mercurial > hg > qcc
changeset 242:244b2df32b67
[project @ 2003-04-14 22:22:34 by bellard]
fixed inline asm without operand case
author | bellard |
---|---|
date | Mon, 14 Apr 2003 22:22:34 +0000 |
parents | f8e0b101d4a2 |
children | 23150418768a |
files | tccasm.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tccasm.c Sun Apr 13 22:42:15 2003 +0000 +++ b/tccasm.c Mon Apr 14 22:22:34 2003 +0000 @@ -710,12 +710,17 @@ operands, nb_operands, nb_outputs, 1, input_regs_allocated); - /* substitute the operands in the asm string */ + /* substitute the operands in the asm string. No substitution is + done if no operands (GCC behaviour) */ #ifdef ASM_DEBUG printf("asm: \"%s\"\n", (char *)astr.data); #endif - subst_asm_operands(operands, nb_operands, nb_outputs, &astr1, &astr); - cstr_free(&astr); + if (nb_operands > 0) { + subst_asm_operands(operands, nb_operands, nb_outputs, &astr1, &astr); + cstr_free(&astr); + } else { + astr1 = astr; + } #ifdef ASM_DEBUG printf("subst_asm: \"%s\"\n", (char *)astr1.data); #endif