Skip to content

Commit

Permalink
Add comment explaining what YY_FATAL_ERROR does
Browse files Browse the repository at this point in the history
Thanks to @1ndahous3.
  • Loading branch information
plusvic committed Nov 27, 2023
1 parent 330bc74 commit 72dc612
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libyara/include/yara/lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ union YYSTYPE;
int yylex( \
union YYSTYPE* yylval_param, yyscan_t yyscanner, YR_COMPILER* compiler)


// The default behavior when a fatal error occurs in the parser is calling
// exit(YY_EXIT_FAILURE) for terminating the process. This is not acceptable
// for a library, which should return gracefully to the calling program. For
// this reason we redefine the YY_FATAL_ERROR macro so that it expands to our
// own function instead of the one provided by default.
#define YY_FATAL_ERROR(msg) yara_yyfatal(yyscanner, msg)


Expand Down

0 comments on commit 72dc612

Please sign in to comment.