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:
Moe Charm
2025-08-26 03:26:55 +09:00
parent 5765953e5f
commit fd2eb25eb9
18 changed files with 941 additions and 42 deletions

View 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");
}