mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibRegex: Make get_opcode() return a reference
Previously this would return a pointer which could be null if the requested opcode was invalid. This should never be the case though so let's VERIFY() that instead.
This commit is contained in:
parent
cd49fb0229
commit
281f39073d
Notes:
sideshowbarker
2024-07-18 12:15:32 +09:00
Author: https://github.com/gunnarbeutner
Commit: 281f39073d
Pull-request: https://github.com/SerenityOS/serenity/pull/8044
Reviewed-by: https://github.com/alimpfard
4 changed files with 24 additions and 37 deletions
|
@ -39,19 +39,14 @@ public:
|
|||
auto& bytecode = regex.parser_result.bytecode;
|
||||
|
||||
for (;;) {
|
||||
auto* opcode = bytecode.get_opcode(state);
|
||||
if (!opcode) {
|
||||
dbgln("Wrong opcode... failed!");
|
||||
return;
|
||||
}
|
||||
|
||||
print_opcode("PrintBytecode", *opcode, state);
|
||||
auto& opcode = bytecode.get_opcode(state);
|
||||
print_opcode("PrintBytecode", opcode, state);
|
||||
out(m_file, "{}", m_debug_stripline);
|
||||
|
||||
if (is<OpCode_Exit>(*opcode))
|
||||
if (is<OpCode_Exit>(opcode))
|
||||
break;
|
||||
|
||||
state.instruction_position += opcode->size();
|
||||
state.instruction_position += opcode.size();
|
||||
}
|
||||
|
||||
fflush(m_file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue