mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 16:28:48 +00:00
LibJS: Don't use null DFS for break/continue statements without a label
This commit is contained in:
parent
761d16141d
commit
78491204d9
Notes:
sideshowbarker
2024-07-17 03:14:39 +09:00
Author: https://github.com/DanShaders
Commit: 78491204d9
Pull-request: https://github.com/SerenityOS/serenity/pull/22926
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/davidot ✅
3 changed files with 17 additions and 17 deletions
|
@ -2199,12 +2199,12 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> ContinueStatement::
|
|||
// FIXME: Handle finally blocks in a graceful manner
|
||||
// We need to execute the finally block, but tell it to resume
|
||||
// execution at the designated block
|
||||
if (m_target_label.is_null()) {
|
||||
if (!m_target_label.has_value()) {
|
||||
generator.generate_continue();
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
generator.generate_continue(m_target_label);
|
||||
generator.generate_continue(m_target_label.value());
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
|
@ -2415,12 +2415,12 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> BreakStatement::gen
|
|||
// FIXME: Handle finally blocks in a graceful manner
|
||||
// We need to execute the finally block, but tell it to resume
|
||||
// execution at the designated block
|
||||
if (m_target_label.is_null()) {
|
||||
if (!m_target_label.has_value()) {
|
||||
generator.generate_break();
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
generator.generate_break(m_target_label);
|
||||
generator.generate_break(m_target_label.value());
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue