fix signed/unsigned result issue on 32-bit platforms (issue #5050)

(expression parser was rebuilt with bison 1.875d as well)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-08-29 20:43:16 +00:00
parent 464c3dca3c
commit 830943cd0d
5 changed files with 135 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
/* A Bison parser, made by GNU Bison 1.875. */ /* A Bison parser, made by GNU Bison 1.875d. */
/* Skeleton parser for Yacc-like parsing with Bison, /* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -135,7 +135,7 @@
#ifndef SOLARIS #ifndef SOLARIS
#include <err.h> #include <err.h>
#else #else
#define quad_t uint64_t #define quad_t int64_t
#endif #endif
#include <errno.h> #include <errno.h>
#include <regex.h> #include <regex.h>
@@ -260,7 +260,7 @@ typedef union YYSTYPE {
struct val *val; struct val *val;
} YYSTYPE; } YYSTYPE;
/* Line 191 of yacc.c. */ /* Line 191 of yacc.c. */
#line 263 "ast_expr2.c" #line 264 "ast_expr2.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
@@ -287,22 +287,29 @@ extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
/* Line 214 of yacc.c. */ /* Line 214 of yacc.c. */
#line 290 "ast_expr2.c" #line 291 "ast_expr2.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE #if ! defined (yyoverflow) || YYERROR_VERBOSE
# ifndef YYFREE
# define YYFREE free
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# endif
/* The parser invokes alloca or malloc; define the necessary symbols. */ /* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA # ifdef YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca # if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
# endif
# else # else
# ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H)
# if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca
# define YYSTACK_ALLOC alloca # else
# else # ifdef __GNUC__
# ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca
# define YYSTACK_ALLOC __builtin_alloca
# endif
# endif # endif
# endif # endif
# endif # endif
@@ -315,20 +322,21 @@ extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t # define YYSIZE_T size_t
# endif # endif
# define YYSTACK_ALLOC malloc # define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE free # define YYSTACK_FREE YYFREE
# endif # endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \ #if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \ && (! defined (__cplusplus) \
|| (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
&& defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
short yyss; short int yyss;
YYSTYPE yyvs; YYSTYPE yyvs;
YYLTYPE yyls; YYLTYPE yyls;
}; };
@@ -339,13 +347,13 @@ union yyalloc
/* The size of an array large to enough to hold all stacks, each with /* The size of an array large to enough to hold all stacks, each with
N elements. */ N elements. */
# define YYSTACK_BYTES(N) \ # define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM) + 2 * YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do /* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */ not overlap. */
# ifndef YYCOPY # ifndef YYCOPY
# if 1 < __GNUC__ # if defined (__GNUC__) && 1 < __GNUC__
# define YYCOPY(To, From, Count) \ # define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From))) __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else # else
@@ -381,7 +389,7 @@ union yyalloc
#if defined (__STDC__) || defined (__cplusplus) #if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char; typedef signed char yysigned_char;
#else #else
typedef short yysigned_char; typedef short int yysigned_char;
#endif #endif
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
@@ -476,10 +484,10 @@ static const unsigned char yyrline[] =
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] = static const char *const yytname[] =
{ {
"$end", "error", "$undefined", "TOK_COLONCOLON", "TOK_COND", "TOK_OR", "$end", "error", "$undefined", "TOK_COLONCOLON", "TOK_COND", "TOK_OR",
"TOK_AND", "TOK_NE", "TOK_LE", "TOK_GE", "TOK_LT", "TOK_GT", "TOK_EQ", "TOK_AND", "TOK_NE", "TOK_LE", "TOK_GE", "TOK_LT", "TOK_GT", "TOK_EQ",
"TOK_MINUS", "TOK_PLUS", "TOK_MOD", "TOK_DIV", "TOK_MULT", "TOK_COMPL", "TOK_MINUS", "TOK_PLUS", "TOK_MOD", "TOK_DIV", "TOK_MULT", "TOK_COMPL",
"TOK_EQTILDE", "TOK_COLON", "TOK_LP", "TOK_RP", "TOKEN", "$accept", "TOK_EQTILDE", "TOK_COLON", "TOK_LP", "TOK_RP", "TOKEN", "$accept",
"start", "expr", 0 "start", "expr", 0
}; };
#endif #endif
@@ -487,7 +495,7 @@ static const char *const yytname[] =
# ifdef YYPRINT # ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */ token YYLEX-NUM. */
static const unsigned short yytoknum[] = static const unsigned short int yytoknum[] =
{ {
0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
@@ -624,7 +632,8 @@ static const unsigned char yystos[] =
#define YYACCEPT goto yyacceptlab #define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab #define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1 #define YYERROR goto yyerrorlab
/* Like YYERROR except do call yyerror. This remains here temporarily /* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC. to ease the transition to the new meaning of YYERROR, for GCC.
@@ -658,11 +667,11 @@ while (0)
are run). */ are run). */
#ifndef YYLLOC_DEFAULT #ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \ # define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.first_line = Rhs[1].first_line; \ ((Current).first_line = (Rhs)[1].first_line, \
Current.first_column = Rhs[1].first_column; \ (Current).first_column = (Rhs)[1].first_column, \
Current.last_line = Rhs[N].last_line; \ (Current).last_line = (Rhs)[N].last_line, \
Current.last_column = Rhs[N].last_column; (Current).last_column = (Rhs)[N].last_column)
#endif #endif
/* YYLEX -- calling `yylex' with the right arguments. */ /* YYLEX -- calling `yylex' with the right arguments. */
@@ -706,17 +715,17 @@ do { \
/*------------------------------------------------------------------. /*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its | | yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (cinluded). | | TOP (included). |
`------------------------------------------------------------------*/ `------------------------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus) #if defined (__STDC__) || defined (__cplusplus)
static void static void
yy_stack_print (short *bottom, short *top) yy_stack_print (short int *bottom, short int *top)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (bottom, top)
short *bottom; short int *bottom;
short *top; short int *top;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
@@ -746,9 +755,9 @@ yy_reduce_print (yyrule)
#endif #endif
{ {
int yyi; int yyi;
unsigned int yylineno = yyrline[yyrule]; unsigned int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
yyrule - 1, yylineno); yyrule - 1, yylno);
/* Print the symbols being reduced, and their result. */ /* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
@@ -785,7 +794,7 @@ int yydebug;
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */ evaluated with infinite-precision integer arithmetic. */
#if YYMAXDEPTH == 0 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
# undef YYMAXDEPTH # undef YYMAXDEPTH
#endif #endif
@@ -989,9 +998,9 @@ YYLTYPE yylloc;
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
short yyssa[YYINITDEPTH]; short int yyssa[YYINITDEPTH];
short *yyss = yyssa; short int *yyss = yyssa;
register short *yyssp; register short int *yyssp;
/* The semantic value stack. */ /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE yyvsa[YYINITDEPTH];
@@ -1032,6 +1041,7 @@ YYLTYPE yylloc;
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
yylsp = yyls; yylsp = yyls;
goto yysetstate; goto yysetstate;
/*------------------------------------------------------------. /*------------------------------------------------------------.
@@ -1057,7 +1067,7 @@ YYLTYPE yylloc;
these so that the &'s don't force the real ones into these so that the &'s don't force the real ones into
memory. */ memory. */
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss; short int *yyss1 = yyss;
YYLTYPE *yyls1 = yyls; YYLTYPE *yyls1 = yyls;
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
@@ -1085,7 +1095,7 @@ YYLTYPE yylloc;
yystacksize = YYMAXDEPTH; yystacksize = YYMAXDEPTH;
{ {
short *yyss1 = yyss; short int *yyss1 = yyss;
union yyalloc *yyptr = union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
@@ -1214,7 +1224,7 @@ yyreduce:
yyval = yyvsp[1-yylen]; yyval = yyvsp[1-yylen];
/* Default location. */ /* Default location. */
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
YY_REDUCE_PRINT (yyn); YY_REDUCE_PRINT (yyn);
switch (yyn) switch (yyn)
{ {
@@ -1366,8 +1376,8 @@ yyreduce:
} }
/* Line 991 of yacc.c. */ /* Line 1010 of yacc.c. */
#line 1370 "ast_expr2.c" #line 1381 "ast_expr2.c"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
@@ -1408,18 +1418,33 @@ yyerrlab:
{ {
YYSIZE_T yysize = 0; YYSIZE_T yysize = 0;
int yytype = YYTRANSLATE (yychar); int yytype = YYTRANSLATE (yychar);
const char* yyprefix;
char *yymsg; char *yymsg;
int yyx, yycount; int yyx;
yycount = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in /* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */ YYCHECK. */
for (yyx = yyn < 0 ? -yyn : 0; int yyxbegin = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 0;
yyprefix = ", expecting ";
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
yysize += yystrlen (yytname[yyx]) + 15, yycount++; {
yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
yysize += yystrlen (yytname[yytype]); yycount += 1;
if (yycount == 5)
{
yysize = 0;
break;
}
}
yysize += (sizeof ("syntax error, unexpected ")
+ yystrlen (yytname[yytype]));
yymsg = (char *) YYSTACK_ALLOC (yysize); yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0) if (yymsg != 0)
{ {
@@ -1428,16 +1453,13 @@ yyerrlab:
if (yycount < 5) if (yycount < 5)
{ {
yycount = 0; yyprefix = ", expecting ";
for (yyx = yyn < 0 ? -yyn : 0; for (yyx = yyxbegin; yyx < yyxend; ++yyx)
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{ {
const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyprefix);
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]); yyp = yystpcpy (yyp, yytname[yyx]);
yycount++; yyprefix = " or ";
} }
} }
yyerror (yymsg); yyerror (yymsg);
@@ -1458,53 +1480,59 @@ yyerrlab:
/* If just tried and failed to reuse lookahead token after an /* If just tried and failed to reuse lookahead token after an
error, discard it. */ error, discard it. */
/* Return failure if at end of input. */ if (yychar <= YYEOF)
if (yychar == YYEOF)
{ {
/* Pop the error token. */ /* If at end of input, pop the error token,
YYPOPSTACK; then the rest of the stack, then return failure. */
/* Pop the rest of the stack. */ if (yychar == YYEOF)
while (yyss < yyssp) for (;;)
{ {
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); YYPOPSTACK;
yydestruct (yystos[*yyssp], yyvsp, yylsp); if (yyssp == yyss)
YYPOPSTACK; YYABORT;
} YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
YYABORT; yydestruct (yystos[*yyssp], yyvsp, yylsp);
}
} }
else
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); {
yydestruct (yytoken, &yylval, &yylloc); YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
yychar = YYEMPTY; yydestruct (yytoken, &yylval, &yylloc);
*++yylerrsp = yylloc; yychar = YYEMPTY;
*++yylerrsp = yylloc;
}
} }
/* Else will try to reuse lookahead token after shifting the error /* Else will try to reuse lookahead token after shifting the error
token. */ token. */
goto yyerrlab2; goto yyerrlab1;
/*----------------------------------------------------. /*---------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. | | yyerrorlab -- error raised explicitly by YYERROR. |
`----------------------------------------------------*/ `---------------------------------------------------*/
yyerrlab1: yyerrorlab:
/* Suppress GCC warning that yyerrlab1 is unused when no action #ifdef __GNUC__
invokes YYERROR. */ /* Pacify GCC when the user code never invokes YYERROR and the label
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ yyerrorlab therefore never appears in user code. */
&& !defined __cplusplus if (0)
__attribute__ ((__unused__)) goto yyerrorlab;
#endif #endif
yyvsp -= yylen;
yyssp -= yylen;
yystate = *yyssp;
yylerrsp = yylsp; yylerrsp = yylsp;
*++yylerrsp = yyloc; *++yylerrsp = yyloc;
goto yyerrlab2; yylsp -= yylen;
goto yyerrlab1;
/*---------------------------------------------------------------. /*-------------------------------------------------------------.
| yyerrlab2 -- pop states until the error token can be shifted. | | yyerrlab1 -- common code for both syntax error and YYERROR. |
`---------------------------------------------------------------*/ `-------------------------------------------------------------*/
yyerrlab2: yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */ yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;) for (;;)
@@ -1527,9 +1555,8 @@ yyerrlab2:
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[yystate], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp, yylsp);
yyvsp--; YYPOPSTACK;
yystate = *--yyssp; yystate = *yyssp;
yylsp--;
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
@@ -1539,7 +1566,7 @@ yyerrlab2:
YYDPRINTF ((stderr, "Shifting error token, ")); YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval; *++yyvsp = yylval;
YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp)); YYLLOC_DEFAULT (yyloc, yylsp, yylerrsp - yylsp);
*++yylsp = yyloc; *++yylsp = yyloc;
yystate = yyn; yystate = yyn;
@@ -1707,7 +1734,7 @@ to_string (struct val *vp)
return; return;
} }
sprintf (tmp, "%lld", (long long)vp->u.i); sprintf (tmp, "%ld", vp->u.i);
vp->type = AST_EXPR_string; vp->type = AST_EXPR_string;
vp->u.s = tmp; vp->u.s = tmp;
} }

View File

@@ -116,8 +116,8 @@ char *ast_expr (char *arg)
return(pirouni); return(pirouni);
} else { } else {
if (io->val->type == AST_EXPR_integer) { if (io->val->type == AST_EXPR_integer) {
pirouni=malloc(256); pirouni = malloc(24);
sprintf (pirouni,"%lld", (long long)io->val->u.i); sprintf(pirouni, "%ld", io->val->u.i);
} }
else { else {
pirouni=strdup(io->val->u.s); pirouni=strdup(io->val->u.s);

View File

@@ -1,7 +1,7 @@
/* A Bison parser, made by GNU Bison 1.875. */ /* A Bison parser, made by GNU Bison 1.875d. */
/* Skeleton parser for Yacc-like parsing with Bison, /* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -82,8 +82,8 @@
typedef union YYSTYPE { typedef union YYSTYPE {
struct val *val; struct val *val;
} YYSTYPE; } YYSTYPE;
/* Line 1249 of yacc.c. */ /* Line 1285 of yacc.c. */
#line 86 "ast_expr2.h" #line 87 "ast_expr2.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1

View File

@@ -349,7 +349,7 @@ to_string (struct val *vp)
return; return;
} }
sprintf (tmp, "%lld", (long long)vp->u.i); sprintf (tmp, "%ld", vp->u.i);
vp->type = AST_EXPR_string; vp->type = AST_EXPR_string;
vp->u.s = tmp; vp->u.s = tmp;
} }

View File

@@ -453,7 +453,7 @@ static yyconst flex_int16_t yy_chk[56] =
#ifndef SOLARIS #ifndef SOLARIS
#include <err.h> #include <err.h>
#else #else
#define quad_t uint64_t #define quad_t int64_t
#endif #endif
#include <errno.h> #include <errno.h>
#include <regex.h> #include <regex.h>
@@ -2104,8 +2104,8 @@ char *ast_expr (char *arg)
return(pirouni); return(pirouni);
} else { } else {
if (io->val->type == AST_EXPR_integer) { if (io->val->type == AST_EXPR_integer) {
pirouni=malloc(256); pirouni = malloc(24);
sprintf (pirouni,"%lld", (long long)io->val->u.i); sprintf(pirouni, "%ld", io->val->u.i);
} }
else { else {
pirouni=strdup(io->val->u.s); pirouni=strdup(io->val->u.s);