Correct the pat parser time overflow.

* Bug: In pat/src/pat_decl_y.y the yylval union type for "valu" was int
    instead of long. In pat_desc_y.y it was long, and pat_decl_l.l was
    using the wrong one. That is Flex was writting an int (4 bits) but
    bison was reading a long (8 bits), so the four upper bits were
    random. Dis show only under 64 bits where int and long have
    differnt sizes...
      There is something strange nevertheless in this tool, the flex
    part for pat_desc seems to be missing, but it compiles (and run).
This commit is contained in:
Jean-Paul Chaput 2018-04-19 13:45:43 +02:00
parent bf8fe82403
commit d2e69df05e
3 changed files with 3 additions and 3 deletions

View File

@ -186,7 +186,7 @@ letter [a-zA-Z]
}
<INITIAL,OUT_PAT,DTC_FRM>(0|[1-9][0-9]*) {
/*printf ("AbstractLit\n");*/
yylval.valu = atoi (yytext);
yylval.valu = atol (yytext);
return (AbstractLit);
}
<INS_PAT>[0-9a-fA-FuU\*\+\-\? \t\n]+ {

View File

@ -396,7 +396,7 @@ struct paseq *ptseq ;
%union
{
int valu;
long valu;
float fval;
char immd;
char *text;

View File

@ -892,7 +892,7 @@ unsigned char mode ; /* the description style */
%union
{
long valu;
long valu;
float fval;
char immd;
char *text;