LibRegex: Avoid use-after-return of MatchState in 'is_an_eligible_jump'

The opcode may have last been accessed by
block_satisfies_atomic_rewrite_precondition, which would set it to a
state that no longer exists.
Set the state to the correct one unconditionally to ensure we're looking
at the right value.
Fixes #5145.
This commit is contained in:
Ali Mohammad Pur 2025-06-24 16:41:28 +02:00 committed by Jelle Raaijmakers
commit b0e471228d
Notes: github-actions[bot] 2025-06-24 16:44:28 +00:00
2 changed files with 5 additions and 4 deletions

View file

@ -652,7 +652,7 @@ public:
ALWAYS_INLINE StringView name() const;
static StringView name(OpCodeId);
ALWAYS_INLINE void set_state(MatchState& state) { m_state = &state; }
ALWAYS_INLINE void set_state(MatchState const& state) { m_state = &state; }
ALWAYS_INLINE void set_bytecode(ByteCode& bytecode) { m_bytecode = &bytecode; }
@ -673,7 +673,7 @@ public:
protected:
ByteCode* m_bytecode { nullptr };
MatchState* m_state { nullptr };
MatchState const* m_state { nullptr };
};
class OpCode_Exit final : public OpCode {