]> granicus.if.org Git - flex/commitdiff
Fixed deserialization of --fast tables.
authorJohn Millaway <john43@users.sourceforge.net>
Mon, 9 Sep 2002 22:06:36 +0000 (22:06 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Mon, 9 Sep 2002 22:06:36 +0000 (22:06 +0000)
TODO
flex.skl

diff --git a/TODO b/TODO
index b6740c93d3b17ec4ba1564dc1df14d6a45f397ec..5cb824ef8a744fb7cd69c229fd68639271730809 100644 (file)
--- a/TODO
+++ b/TODO
@@ -52,8 +52,6 @@
 
 * Tables API
 
-** Fix deserialization of --fast tables
-
 ** Handle reject-triggered tables
 
 ** Lookup table by name
index f11e44c0201bde01a83c21ca2fc00c5c87690ebe..a75068a8917320ef2e463e1467b95c25ca1306fc 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -2196,8 +2196,16 @@ static int yytbl_data_load YYFARGS2 (struct yytbl_dmap *, dmap, struct yytbl_rea
         return -1;
     }
 
-    /* Allocate space for table. */
-    bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;
+    /* Allocate space for table.
+     * The --full yy_transition table is a special case, since we
+     * need the dmap.dm_sz entry to tell us the sizeof the individual
+     * struct members.
+     */
+    if ((td.td_flags & YYTD_STRUCT))
+        bytes = sizeof(struct yy_trans_info) * td.td_lolen * (td.td_hilen ? td.td_hilen : 1);
+    else
+        bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;
+
     if(YY_TABLES_VERIFY)
         /* We point to the array itself */
         p = dmap->dm_arr; 
@@ -2284,6 +2292,7 @@ static int yytbl_data_load YYFARGS2 (struct yytbl_dmap *, dmap, struct yytbl_rea
                 /* t32 is an index into the transition array. */
                 struct yy_trans_info *v;
 
+
                 if (!transdmap){
                     yy_fatal_error("transition table not found" /*TODO: not fatal.*/ YY_CALL_LAST_ARG);
                     return -1;