aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard>2003-04-14 22:22:34 +0000
committerbellard <bellard>2003-04-14 22:22:34 +0000
commit6e197e3d5d43f0c98f27c2a905f0f29c9a82119c (patch)
treea5ff7f44333876c72b60596a19caa276f204aab4
parent85fa15e64c9d54d8094f9c9af2615a6faa80b5b7 (diff)
downloadtinycc-6e197e3d5d43f0c98f27c2a905f0f29c9a82119c.tar.gz
tinycc-6e197e3d5d43f0c98f27c2a905f0f29c9a82119c.tar.bz2
fixed inline asm without operand case
-rw-r--r--tccasm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tccasm.c b/tccasm.c
index 5b3b359..22f2931 100644
--- a/tccasm.c
+++ b/tccasm.c
@@ -710,12 +710,17 @@ static void asm_instr(void)
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