vfprintf: Introduce JUMP_TABLE_BASE_LABEL
authorFlorian Weimer <fweimer@redhat.com>
Sun, 1 Mar 2015 20:47:31 +0000 (21:47 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 6 Mar 2015 09:29:49 +0000 (10:29 +0100)
This makes the offset handling more explicit and avoids
cross-references between the jump tables.

ChangeLog
stdio-common/vfprintf.c

index 6c6ff44..94a2402 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * stdio-common/vfprintf.c (THOUSANDS_SEP_T): New typedef.
        (group_number, vfprintf): Use it.
+        (JUMP_TABLE_BASE_LABEL): New preprocessor macro.
+        (JUMP, REF): Use it.
 
 2015-03-06  Rical Jasan  <ricaljasan@pacific.net>
 
index d575994..030d33d 100644 (file)
@@ -304,7 +304,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
          spec = (ChExpr);                                                    \
          offset = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown)              \
            : table[CHAR_CLASS (spec)];                                       \
-         ptr = &&do_form_unknown + offset;                                   \
+         ptr = &&JUMP_TABLE_BASE_LABEL + offset;                             \
          goto *ptr;                                                          \
        }                                                                     \
       while (0)
@@ -1329,7 +1329,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
   do
     {
 #ifdef SHARED
-# define REF(Name) &&do_##Name - &&do_form_unknown
+# define JUMP_TABLE_BASE_LABEL do_form_unknown
+# define REF(Name) (&&do_##Name - &&JUMP_TABLE_BASE_LABEL)
 #else
 # define REF(Name) &&do_##Name
 #endif
@@ -1897,7 +1898,9 @@ do_positional:
       {
 #undef REF
 #ifdef SHARED
-# define REF(Name) &&do2_##Name - &&do_form_unknown
+# undef JUMP_TABLE_BASE_LABEL
+# define JUMP_TABLE_BASE_LABEL do2_form_unknown
+# define REF(Name) (&&do2_##Name - &&JUMP_TABLE_BASE_LABEL)
 #else
 # define REF(Name) &&do2_##Name
 #endif