Merged revisions 97889 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r97889 | murf | 2008-01-10 14:37:10 -0700 (Thu, 10 Jan 2008) | 1 line

Applied the same fixes for ael.flex as was done in 97849 for ast_expr2.fl; overrode the normally generate yyfree func with our own version that checks the pointer for non-null before passing to free(). Also takes care of a little problem with 2.5.33 and the use of the __STDC_VERSION__ macro.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2008-01-10 21:46:56 +00:00
parent 33fadcc67c
commit 3f152e5ff0
3 changed files with 90 additions and 76 deletions

View File

@@ -35,6 +35,10 @@
%option prefix="ael_yy"
%option noyywrap 8bit
/* yyfree normally just frees its arg. It can be null sometimes,
which some systems will complain about, so, we'll define our own version */
%option noyyfree
/* batch gives a bit more performance if we are using it in
* a non-interactive mode. We probably don't care much.
*/
@@ -479,6 +483,12 @@ static void pbcpush(char x)
pbcstack[pbcpos++] = x;
}
void ael_yyfree(void *ptr, yyscan_t yyscanner)
{
if (ptr)
free( (char*) ptr );
}
static int pbcpop(char x)
{
if ( ( x == ')' && pbcstack[pbcpos-1] == '(' )