Skip to content

Commit dcd45e9

Browse files
committed
Fix EOF checks in fmtscan
Previously the EOF checks were always false. Change-Id: I2f5b1b56dcf88db70bf5839db8293789024a1b10
1 parent 2520afc commit dcd45e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/fmtscan.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -635,27 +635,27 @@ static get_char_t skip_inline_asm(parser_t *p, bool underscore)
635635
get_char_t ch;
636636

637637
ch = get_char(p);
638+
if (UNLIKELY(ch == PARSER_EOF))
639+
return ch;
638640
if (ch != 's')
639641
goto check_s_failed;
642+
ch = get_char(p);
640643
if (UNLIKELY(ch == PARSER_EOF))
641644
return ch;
642-
ch = get_char(p);
643645
if (ch != 'm')
644646
goto check_m_failed;
645-
if (UNLIKELY(ch == PARSER_EOF))
646-
return ch;
647647

648648
if (underscore) {
649649
ch = get_char(p);
650+
if (UNLIKELY(ch == PARSER_EOF))
651+
return ch;
650652
if (ch != '_')
651653
goto not_wrapped;
654+
ch = get_char(p);
652655
if (UNLIKELY(ch == PARSER_EOF))
653656
return ch;
654-
ch = get_char(p);
655657
if (ch != '_')
656658
goto check_underline_failed;
657-
if (UNLIKELY(ch == PARSER_EOF))
658-
return ch;
659659
}
660660
not_wrapped:
661661

0 commit comments

Comments
 (0)