summaryrefslogtreecommitdiff
path: root/storage/connect/fmdlex.c
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-12-14 23:49:17 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2015-12-14 23:49:17 +0100
commite57876eacf9c74fa3452c793672f220ee8c8135d (patch)
treeac87ff32d7909eb6409a30ef43db6a727766b76b /storage/connect/fmdlex.c
parent2ce0043bf32d547d3438afd09a6917aaad5370ea (diff)
downloadmariadb-git-e57876eacf9c74fa3452c793672f220ee8c8135d.tar.gz
- Fix MDEV-9279. Replacing exit(1) in yy_fatal_error by a longjmp.
modified: storage/connect/fmdlex.c modified: storage/connect/plgdbutl.cpp
Diffstat (limited to 'storage/connect/fmdlex.c')
-rw-r--r--storage/connect/fmdlex.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/storage/connect/fmdlex.c b/storage/connect/fmdlex.c
index 22c3a1e79ad..548a7ae5b7e 100644
--- a/storage/connect/fmdlex.c
+++ b/storage/connect/fmdlex.c
@@ -1,3 +1,5 @@
+#include <setjmp.h>
+
#define yyFlexLexer fmdfFlexLexer
#define yy_create_buffer fmdf_create_buffer
#define yy_delete_buffer fmdf_delete_buffer
@@ -506,13 +508,16 @@ YY_MALLOC_DECL
#define YY_BREAK break;
#endif
+static jmp_buf env;
+
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+ if (setjmp(env))
+ return -1;
/*************************************************************************/
/* Flex parser to analyze date format and produce input and/or output */
@@ -1316,7 +1321,7 @@ char msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
- exit( 1 );
+ longjmp(env, 1 );
}