Refactor specializer to not fold scalars

The specializer now correctly identifies when a compiled value is a
scalar and avoids folding it into a constant node. Instead, it updates
the callee to the specialized version if it's an object. This ensures
that scalar folding does not interfere with the program's execution.
This commit is contained in:
Michael Schimmel
2026-03-05 14:35:29 +01:00
parent 831525b402
commit 6ebf31e2a0
2 changed files with 16 additions and 34 deletions
+1 -1
View File
@@ -783,7 +783,7 @@ impl VM {
}
match &curr.kind {
BoundKind::Constant(v) => self.stack.push(v.clone()),
BoundKind::Constant(v) if !O::ACTIVE => self.stack.push(v.clone()),
_ => {
let val = self.eval_internal(obs, curr)?;
self.stack.push(val);