On May 18, 2015 9:39:36 PM GMT+08:00, Sergey Korshunoff <sey...@gmail.com> 
wrote:
> Hi all,
> there is a patch for the problem. Any suggestions?
> 
> diff -urN tinycc.old/tccasm.c tinycc/tccasm.c
> --- tinycc.old/tccasm.c 2015-05-18 12:30:24.000000000 +0300
> +++ tinycc/tccasm.c     2015-05-18 16:28:03.000000000 +0300
> @@ -779,6 +779,16 @@
>              opcode = tok;
>              next();
>              if (tok == ':') {
> +                /* handle "extern void vide(void); __asm__("vide:
> ret");" as
> +                "__asm__("globl vide\nvide: ret");" */
> +                Sym *sym = sym_find(opcode);
> +                if (sym && (sym->type.t & VT_EXTERN)) {
> +                    sym = label_find(opcode);
> +                    if (!sym) {
> +                        sym = label_push(&s1->asm_labels, opcode, 0);
> +                        sym->type.t = VT_VOID;
> +                    }

The else should throw an error for trying to redefine the symbol.

> +                }
>                  /* new label */
>                  asm_new_label(s1, opcode, 0);

Shouldn't this be part of a else for the outer if?

>                  next();

Ok otherwise.

Tom


_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to