mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
fix: Implement RVM set ops correctly
- treat set subtraction in RVM the same as the interpreter by supporting Value::Set operands in sub_values - emit internal-only builtin names for set union/intersection and register handlers so compiled bytecode resolves without exposing new Rego builtins - add regression coverage for literal set difference/intersection (x/y from failure.rego) in tests/rvm/rego/cases/sets.yaml Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
@@ -142,7 +142,7 @@ impl<'a> Compiler<'a> {
|
||||
|
||||
match op {
|
||||
BinOp::Union => {
|
||||
let builtin_index = self.get_builtin_index("sets.union")?;
|
||||
let builtin_index = self.get_builtin_index("__builtin_sets.union")?;
|
||||
let params = BuiltinCallParams {
|
||||
dest,
|
||||
builtin_index,
|
||||
@@ -156,7 +156,7 @@ impl<'a> Compiler<'a> {
|
||||
self.emit_instruction(Instruction::BuiltinCall { params_index }, span);
|
||||
}
|
||||
BinOp::Intersection => {
|
||||
let builtin_index = self.get_builtin_index("sets.intersection")?;
|
||||
let builtin_index = self.get_builtin_index("__builtin_sets.intersection")?;
|
||||
let params = BuiltinCallParams {
|
||||
dest,
|
||||
builtin_index,
|
||||
|
||||
Reference in New Issue
Block a user