Skip to content

Commit 9c38e90

Browse files
committed
Fix vm.ctx.none.as_obejct not to make clone
Signed-off-by: snowapril <sinjihng@gmail.com>
1 parent fd4f694 commit 9c38e90

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

vm/src/frame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ impl ExecutingFrame<'_> {
16541654
bytecode::BinaryOperator::Add => vm._add(a_ref, b_ref),
16551655
bytecode::BinaryOperator::Multiply => vm._mul(a_ref, b_ref),
16561656
bytecode::BinaryOperator::MatrixMultiply => vm._matmul(a_ref, b_ref),
1657-
bytecode::BinaryOperator::Power => vm._pow(a_ref, b_ref, &vm.ctx.none()),
1657+
bytecode::BinaryOperator::Power => vm._pow(a_ref, b_ref, vm.ctx.none.as_object()),
16581658
bytecode::BinaryOperator::Divide => vm._truediv(a_ref, b_ref),
16591659
bytecode::BinaryOperator::FloorDivide => vm._floordiv(a_ref, b_ref),
16601660
bytecode::BinaryOperator::Modulo => vm._mod(a_ref, b_ref),
@@ -1680,7 +1680,7 @@ impl ExecutingFrame<'_> {
16801680
bytecode::BinaryOperator::Add => vm._iadd(a_ref, b_ref),
16811681
bytecode::BinaryOperator::Multiply => vm._imul(a_ref, b_ref),
16821682
bytecode::BinaryOperator::MatrixMultiply => vm._imatmul(a_ref, b_ref),
1683-
bytecode::BinaryOperator::Power => vm._ipow(a_ref, b_ref, &vm.ctx.none()),
1683+
bytecode::BinaryOperator::Power => vm._ipow(a_ref, b_ref, vm.ctx.none.as_object()),
16841684
bytecode::BinaryOperator::Divide => vm._itruediv(a_ref, b_ref),
16851685
bytecode::BinaryOperator::FloorDivide => vm._ifloordiv(a_ref, b_ref),
16861686
bytecode::BinaryOperator::Modulo => vm._imod(a_ref, b_ref),

vm/src/stdlib/builtins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ mod builtins {
622622
modulus,
623623
} = args;
624624
match modulus {
625-
None => vm._pow(&x, &y, &vm.ctx.none()),
625+
None => vm._pow(&x, &y, vm.ctx.none.as_object()),
626626
Some(z) => vm._pow(&x, &y, &z),
627627
}
628628
}

vm/src/stdlib/operator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ mod _operator {
133133

134134
#[pyfunction]
135135
fn pow(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> PyResult {
136-
vm._pow(&a, &b, &vm.ctx.none())
136+
vm._pow(&a, &b, vm.ctx.none.as_object())
137137
}
138138

139139
#[pyfunction]
@@ -292,7 +292,7 @@ mod _operator {
292292

293293
#[pyfunction]
294294
fn ipow(a: PyObjectRef, b: PyObjectRef, vm: &VirtualMachine) -> PyResult {
295-
vm._ipow(&a, &b, &vm.ctx.none())
295+
vm._ipow(&a, &b, vm.ctx.none.as_object())
296296
}
297297

298298
#[pyfunction]

0 commit comments

Comments
 (0)