From a3936f10eb59971203a9b478a439a409144d44ff Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 2 Jun 2020 14:26:23 +0200 Subject: [PATCH] LibWeb: Fix tokenizing scripts with '<' in them The EMIT_CHARACTER_AND_RECONSUME_IN was emitting the current token instead of the specified codepoint. --- Libraries/LibWeb/Parser/HTMLTokenizer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/LibWeb/Parser/HTMLTokenizer.cpp b/Libraries/LibWeb/Parser/HTMLTokenizer.cpp index 88efaae5f6..a8c7cf1e86 100644 --- a/Libraries/LibWeb/Parser/HTMLTokenizer.cpp +++ b/Libraries/LibWeb/Parser/HTMLTokenizer.cpp @@ -84,12 +84,12 @@ return m_queued_tokens.dequeue(); \ } while (0) -#define EMIT_CHARACTER_AND_RECONSUME_IN(codepoint, new_state) \ - do { \ - m_queued_tokens.enqueue(m_current_token); \ - will_reconsume_in(State::new_state); \ - m_state = State::new_state; \ - goto new_state; \ +#define EMIT_CHARACTER_AND_RECONSUME_IN(codepoint, new_state) \ + do { \ + m_queued_tokens.enqueue(HTMLToken::make_character(codepoint)); \ + will_reconsume_in(State::new_state); \ + m_state = State::new_state; \ + goto new_state; \ } while (0) #define FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE \