diff options
author | Stefan Fritsch <sf@apache.org> | 2012-11-05 13:39:03 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2012-11-05 13:39:03 +0100 |
commit | 7e127cc39332909957c53f5abc762d40ed1d0e80 (patch) | |
tree | 27c6e5c352370cb082f72a70d354205427d46391 /server/util_expr_scan.l | |
parent | *) mod_cache_disk: Resolve errors while revalidating disk-cached files on (diff) | |
download | apache2-7e127cc39332909957c53f5abc762d40ed1d0e80.tar.xz apache2-7e127cc39332909957c53f5abc762d40ed1d0e80.zip |
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
Diffstat (limited to '')
-rw-r--r-- | server/util_expr_scan.l | 15 |
1 files changed, 15 insertions, 0 deletions
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) |