You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2012/11/05 13:39:03 UTC

svn commit: r1405770 - /httpd/httpd/trunk/server/util_expr_scan.l

Author: sf
Date: Mon Nov  5 12:39:03 2012
New Revision: 1405770

URL: http://svn.apache.org/viewvc?rev=1405770&view=rev
Log:
Properly log flex fatal errors and abort(), instead of the
default of fprintf(stderr, ...) and exit(2)

Modified:
    httpd/httpd/trunk/server/util_expr_scan.l

Modified: httpd/httpd/trunk/server/util_expr_scan.l
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_scan.l?rev=1405770&r1=1405769&r2=1405770&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr_scan.l (original)
+++ httpd/httpd/trunk/server/util_expr_scan.l Mon Nov  5 12:39:03 2012
@@ -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)