Implement Loop Checking for Jump & Goto operations with minor rule restructure.

Loop checking is done whenever a rule is registered to a chain.
Includes restructuring how rules are added/registered to chains to make loop
checking consistent and restrict adding operations to already registered rules.

Change also performs minor code re-org, moving evaluation methods to the top.

PiperOrigin-RevId: 663039449
This commit is contained in:
Jayden Nyamiaka
2024-08-14 13:46:45 -07:00
committed by gVisor bot
parent f2ed1daa01
commit 0f4d195bff
3 changed files with 912 additions and 182 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -116,7 +116,9 @@ func InterpretRule(ruleString string) (*Rule, error) {
if err != nil {
return nil, err
}
r.AddOperation(op)
if err := r.AddOperation(op); err != nil {
return nil, err
}
}
return r, nil