[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] yysyntax_error: make it manage its own memory.
From: |
Joel E. Denny |
Subject: |
Re: [PATCH] yysyntax_error: make it manage its own memory. |
Date: |
Sat, 12 Sep 2009 21:27:48 -0400 (EDT) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
On Fri, 11 Sep 2009, Joel E. Denny wrote:
> Here are two new patches that I'd like to apply to master and branch-2.5.
>
> The first patch adds two new test groups to regression.at.
> >From dc23d678388635a058492294f6cd45105f581c98 Mon Sep 17 00:00:00 2001
> From: Joel E. Denny <address@hidden>
> Date: Thu, 10 Sep 2009 18:29:01 -0400
> Subject: [PATCH] yacc.c: test yysyntax_error memory management more.
>
> * tests/regression.at (-Dparse.error=verbose and
> YYSTACK_USE_ALLOCA): New test group.
> (-Dparse.error=verbose overflow): New test group that reveals
> an obscure bug. Expected fail for now.
The following needs to be folded into that patch to fix
maintainer-push-check. It also improves the diagnostic.
diff --git a/tests/regression.at b/tests/regression.at
index 7e17a91..de91823 100644
--- a/tests/regression.at
+++ b/tests/regression.at
@@ -1382,7 +1382,12 @@ check:
fprintf (stderr,
"The assumptions of this test group are no longer\n"
"valid, so it may no longer catch the error it was\n"
- "designed to catch.\n");
+ "designed to catch. Specifically, the following\n"
+ "values should all be 255:\n\n");
+ fprintf (stderr, " yymsg_alloc = %d\n", yymsg_alloc);
+ fprintf (stderr, " YYSTACK_ALLOC_MAXIMUM = %d\n",
+ YYSTACK_ALLOC_MAXIMUM);
+ fprintf (stderr, " YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM);
YYABORT;
}
}
@@ -1417,6 +1422,10 @@ yylex (void)
int
main (void)
{
+ /* Push parsers throw away the message buffer between tokens, so skip
+ this test under maintainer-push-check. */
+ if (YYPUSH)
+ return 77;
return yyparse ();
}
]])