chore: Harden instructions and program (#535)

Also enforce sane limits in program

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-30 18:20:07 -06:00
committed by GitHub
parent 49958c2ece
commit 28891ef883
17 changed files with 670 additions and 634 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ impl RegoVM {
}
self.executed_instructions += 1;
let instruction = program.instructions[self.pc].clone();
let instruction = program.instructions[self.pc];
match self.execute_instruction(&program, instruction)? {
InstructionOutcome::Continue => {
@@ -351,7 +351,7 @@ impl RegoVM {
}
self.pc = frame_pc;
let instruction = program.instructions[self.pc].clone();
let instruction = program.instructions[self.pc];
if let Some(frame_info) = self.execution_stack.last() {
if let FrameKind::Comprehension { context, .. } = &frame_info.kind {
if context.iteration_state.is_none()