mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2026-01-01 14:15:43 +03:00
rose: move END instruction to start of enum
Stop overloading END as the last Rose interpreter instruction, use new sentinel LAST_ROSE_INSTRUCTION for that. This change will also make it easier to add new instructions without renumbering END and thus changing all generated bytecodes.
This commit is contained in:
committed by
Matthew Barr
parent
997787bd4b
commit
6e533589bb
@@ -1389,9 +1389,15 @@ hwlmcb_rv_t roseRunProgram_i(const struct RoseEngine *t,
|
||||
assert(pc >= pc_base);
|
||||
assert((size_t)(pc - pc_base) < t->size);
|
||||
const u8 code = *(const u8 *)pc;
|
||||
assert(code <= ROSE_INSTR_END);
|
||||
assert(code <= LAST_ROSE_INSTRUCTION);
|
||||
|
||||
switch ((enum RoseInstructionCode)code) {
|
||||
PROGRAM_CASE(END) {
|
||||
DEBUG_PRINTF("finished\n");
|
||||
return HWLM_CONTINUE_MATCHING;
|
||||
}
|
||||
PROGRAM_NEXT_INSTRUCTION
|
||||
|
||||
PROGRAM_CASE(ANCHORED_DELAY) {
|
||||
if (in_anchored && end > t->floatingMinLiteralMatchOffset) {
|
||||
DEBUG_PRINTF("delay until playback\n");
|
||||
@@ -1971,12 +1977,6 @@ hwlmcb_rv_t roseRunProgram_i(const struct RoseEngine *t,
|
||||
}
|
||||
}
|
||||
PROGRAM_NEXT_INSTRUCTION
|
||||
|
||||
PROGRAM_CASE(END) {
|
||||
DEBUG_PRINTF("finished\n");
|
||||
return HWLM_CONTINUE_MATCHING;
|
||||
}
|
||||
PROGRAM_NEXT_INSTRUCTION
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user