Skip to content

Commit ec3162c

Browse files
committed
Fix infinite loop in parser_lex_magic_comment
1 parent e09ca77 commit ec3162c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

prism/prism.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7562,7 +7562,7 @@ parser_lex_magic_comment(pm_parser_t *parser, bool semantic_token_seen) {
75627562
cursor = start;
75637563
while (cursor < end) {
75647564
if (indicator) {
7565-
cursor += pm_strspn_whitespace(cursor, end - cursor);
7565+
while (cursor < end && (pm_char_is_magic_comment_key_delimiter(*cursor) || pm_char_is_whitespace(*cursor))) cursor++;
75667566
}
75677567

75687568
const uint8_t *key_start = cursor;

0 commit comments

Comments
 (0)