From 7e127cc39332909957c53f5abc762d40ed1d0e80 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 5 Nov 2012 12:39:03 +0000 Subject: [PATCH] Properly log flex fatal errors and abort(), instead of the default of fprintf(stderr, ...) and exit(2) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1405770 13f79535-47bb-0310-9956-ffa450edef68 --- server/util_expr_scan.l | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/util_expr_scan.l b/server/util_expr_scan.l index 513236a940..c75b3744d8 100644 --- a/server/util_expr_scan.l +++ b/server/util_expr_scan.l @@ -42,6 +42,8 @@ %{ #include "util_expr_private.h" #include "util_expr_parse.h" +#include "http_main.h" +#include "http_log.h" #undef YY_INPUT #define YY_INPUT(buf,result,max_size) \ @@ -58,6 +60,19 @@ } \ } +/* + * XXX: It would be nice if we could recover somehow, e.g. via + * XXX: longjmp. It is not clear if the scanner is in any state + * XXX: to be cleaned up, though. + */ +#define YY_FATAL_ERROR(msg) \ + do { \ + ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf, \ + "expr parser fatal error (BUG?): " \ + "%s, exiting", msg); \ + abort(); \ + } while (0) + #define YY_EXTRA_TYPE ap_expr_parse_ctx_t* #define PERROR(msg) do { yyextra->error2 = msg ; return T_ERROR; } while (0) -- 2.40.0