adjust the tail created by CreatePartialString to point to the last cell it pushed to the heap (#586)
This commit is contained in:
@@ -1079,19 +1079,18 @@ impl MachineState {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let h = self.heap.h();
|
|
||||||
|
|
||||||
if atom.as_str().is_empty() {
|
if atom.as_str().is_empty() {
|
||||||
self.fail = true;
|
self.fail = true;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
let pstr = self.heap.allocate_pstr(atom.as_str());
|
let pstr = self.heap.allocate_pstr(atom.as_str());
|
||||||
let pstr_tail = self.heap[h + 1].as_addr(h + 1);
|
|
||||||
|
|
||||||
self.unify(self[temp_v!(2)], pstr);
|
self.unify(self[temp_v!(2)], pstr);
|
||||||
|
|
||||||
if !self.fail {
|
if !self.fail {
|
||||||
|
let h = self.heap.h();
|
||||||
|
let pstr_tail = self.heap[h - 1].as_addr(h - 1);
|
||||||
|
|
||||||
self.unify(self[temp_v!(3)], pstr_tail);
|
self.unify(self[temp_v!(3)], pstr_tail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user