feat(jit): fix segfault
This commit is contained in:
@@ -10,28 +10,28 @@ use crate::vm::VM;
|
||||
use super::Value;
|
||||
|
||||
#[derive(Debug, Constructor, Clone, PartialEq)]
|
||||
pub struct List<'vm> {
|
||||
data: Vector<Value<'vm>>,
|
||||
pub struct List<'jit: 'vm, 'vm> {
|
||||
data: Vector<Value<'jit, 'vm>>,
|
||||
}
|
||||
|
||||
impl<'vm> List<'vm> {
|
||||
impl<'jit: 'vm, 'vm> List<'jit, 'vm> {
|
||||
pub fn empty() -> Self {
|
||||
List {
|
||||
data: Vector::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn push(&mut self, elem: Value<'vm>) {
|
||||
pub fn push(&mut self, elem: Value<'jit, 'vm>) {
|
||||
self.data.push_back_mut(elem);
|
||||
}
|
||||
|
||||
pub fn concat(&mut self, other: &List<'vm>) {
|
||||
pub fn concat(&mut self, other: &List<'jit, 'vm>) {
|
||||
for elem in other.data.iter() {
|
||||
self.data.push_back_mut(elem.clone());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn force_deep(&mut self, vm: &'vm VM<'_>) -> Result<()> {
|
||||
pub fn force_deep(&mut self, vm: &'vm VM<'jit>) -> Result<()> {
|
||||
let mut vec: Vec<_> = self.data.iter().cloned().collect();
|
||||
for v in vec.iter_mut() {
|
||||
v.force_deep(vm)?;
|
||||
@@ -40,7 +40,7 @@ impl<'vm> List<'vm> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn to_public(&self, vm: &'vm VM, seen: &mut HashSet<Value<'vm>>) -> p::Value {
|
||||
pub fn to_public(&self, vm: &'vm VM, seen: &mut HashSet<Value<'jit, 'vm>>) -> p::Value {
|
||||
p::Value::List(p::List::new(
|
||||
self.data
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user