diff options
author | John Millaway <john43@users.sourceforge.net> | 2002-09-09 22:06:36 +0000 |
---|---|---|
committer | John Millaway <john43@users.sourceforge.net> | 2002-09-09 22:06:36 +0000 |
commit | 0e7a34a8e0031a4d2bc6d27925c32bc4e5bdd459 (patch) | |
tree | cba81393b154f366142ffabba3ca1c7b15d00b54 /flex.skl | |
parent | 7872f0e7e8722c2b06bf89391897ecc0dd086d97 (diff) |
Fixed deserialization of --fast tables.
Diffstat (limited to 'flex.skl')
-rw-r--r-- | flex.skl | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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; |