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:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user