vm(compare): fix BoxRef(IntegerBox) comparisons by upstream casts and fallbacks; unify IntegerBox (re-export); as_bool truthiness; NewBox primitive fastpath; phi minimal fallback; add temp debug logs for route tracing
This commit is contained in:
13
src/tests/vm_compare_box.rs
Normal file
13
src/tests/vm_compare_box.rs
Normal file
@ -0,0 +1,13 @@
|
||||
#[test]
|
||||
fn vm_compare_integerbox_boxref_lt() {
|
||||
use crate::backend::vm::VM;
|
||||
use crate::backend::vm::VMValue;
|
||||
use crate::box_trait::IntegerBox;
|
||||
use std::sync::Arc;
|
||||
|
||||
let vm = VM::new();
|
||||
let left = VMValue::BoxRef(Arc::new(IntegerBox::new(0)));
|
||||
let right = VMValue::BoxRef(Arc::new(IntegerBox::new(3)));
|
||||
let out = vm.execute_compare_op(&crate::mir::CompareOp::Lt, &left, &right).unwrap();
|
||||
assert!(out, "0 < 3 should be true");
|
||||
}
|
||||
Reference in New Issue
Block a user