]> git.proxmox.com Git - grub2.git/commitdiff
yylex: use grub_fatal for exit.
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 12 Feb 2016 11:34:54 +0000 (12:34 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 12 Feb 2016 11:34:54 +0000 (12:34 +0100)
lexer calls yylex_fatal on fatal internal errors. yylex_fatal itself is
declared as noreturn and calls exit. Returning from noreturn function has
unpredictable consequences.

grub-core/script/yylex.l

index 9c2cfe11531d055278efdd71c2bf4a18adf6cc4f..95b2191705ac826833e0951fa323242a9f8859d1 100644 (file)
@@ -92,7 +92,7 @@ typedef size_t yy_size_t;
 #define stdout 0
 
 #define fprintf(...) 0
-#define exit(...)
+#define exit(...) grub_fatal("fatal error in lexer")
 #endif
 
 }