diff --git a/Userland/Libraries/LibRegex/RegexByteCode.h b/Userland/Libraries/LibRegex/RegexByteCode.h index d8021adf20..150b67c0aa 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.h +++ b/Userland/Libraries/LibRegex/RegexByteCode.h @@ -334,26 +334,26 @@ public: { // FORKJUMP _ALT - // REGEXP ALT1 + // REGEXP ALT2 // JUMP _END // LABEL _ALT - // REGEXP ALT2 + // REGEXP ALT1 // LABEL _END ByteCode byte_code; empend(static_cast(OpCodeId::ForkJump)); - empend(left.size() + 2); // Jump to the _ALT label + empend(right.size() + 2); // Jump to the _ALT label - for (auto& op : left) + for (auto& op : right) append(move(op)); empend(static_cast(OpCodeId::Jump)); - empend(right.size()); // Jump to the _END label + empend(left.size()); // Jump to the _END label // LABEL _ALT = bytecode.size() + 2 - for (auto& op : right) + for (auto& op : left) append(move(op)); // LABEL _END = alterantive_bytecode.size