fix crash in read_term
@@ -536,7 +536,7 @@ fn push_var_eq_functors<'a>(
loop {
match self.read(stream, &indices.op_dir) {
- Ok(term_write_result) => {
+ Ok(mut term_write_result) => {
let heap_loc = read_heap_cell!(self.heap[term_write_result.heap_loc],
(HeapCellValueTag::PStr | HeapCellValueTag::PStrOffset) => {
pstr_loc_as_cell!(term_write_result.heap_loc)
@@ -568,6 +568,10 @@ fn push_var_eq_functors<'a>(
}
}
+ for var in term_write_result.var_dict.values_mut() {
+ *var = heap_bound_deref(&self.heap, *var);
+ }
+
let singleton_var_list = push_var_eq_functors(
&mut self.heap,
term_write_result.var_dict.iter().filter(|(_, binding)| {
