tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] '.' as code position in asm_expr_unary()


From: Vladimir Vissoultchev
Subject: Re: [Tinycc-devel] '.' as code position in asm_expr_unary()
Date: Mon, 18 Apr 2016 23:20:20 +0300

Probably on PARSE_FLAG_ASM_FILE would be better to leave single dots as tok
= '.' -- that is when next char is not IS_ID it will not become a symbol on
its own.

cheers,
</wqw>

-----Original Message-----
From: Tinycc-devel [mailto:address@hidden
On Behalf Of Sergey Korshunoff
Sent: Monday, April 18, 2016 8:43 PM
To: address@hidden
Subject: Re: [Tinycc-devel] '.' as code position in asm_expr_unary()

> But this label must be handled in a special way.
My current solution:

diff -urN tinycc.old/tccasm.c tinycc/tccasm.c
--- tinycc.old/tccasm.c>2016-04-18 20:32:33.000000000 +0300
+++ tinycc/tccasm.c<--->2016-04-18 20:33:47.000000000 +0300
@@ -117,6 +117,11 @@
             } else {
                 pe->v = 0;
                 pe->sym = sym;
+                if (!strcmp(".",get_tok_str(tok, 0))) {
+                    sym->type.t = VT_STATIC | VT_VOID;
+                    sym->r = cur_text_section->sh_num;
+                    sym->jnext = ind;
+                }
             }
             next();
         } else {

But I don't like call get_tok_str() for each asm identifier.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]