correct PStrLocation offset bug in copier.rs
This commit is contained in:
@@ -84,7 +84,7 @@ impl<'a> HCPreOrderIterator<'a> {
|
|||||||
Addr::PStrLocation(h, n) => {
|
Addr::PStrLocation(h, n) => {
|
||||||
if let HeapCellValue::PartialString(ref pstr) = &self.machine_st.heap[h] {
|
if let HeapCellValue::PartialString(ref pstr) = &self.machine_st.heap[h] {
|
||||||
let s = pstr.block_as_str();
|
let s = pstr.block_as_str();
|
||||||
|
|
||||||
if let Some(c) = s[n ..].chars().next() {
|
if let Some(c) = s[n ..].chars().next() {
|
||||||
if pstr.len() > n + c.len_utf8() {
|
if pstr.len() > n + c.len_utf8() {
|
||||||
self.state_stack.push(Addr::PStrLocation(h, n + c.len_utf8()));
|
self.state_stack.push(Addr::PStrLocation(h, n + c.len_utf8()));
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ impl<T: CopierTarget> CopyTermState<T> {
|
|||||||
let threshold = self.target.threshold();
|
let threshold = self.target.threshold();
|
||||||
|
|
||||||
self.target[self.scan] =
|
self.target[self.scan] =
|
||||||
HeapCellValue::Addr(Addr::PStrLocation(threshold, n));
|
HeapCellValue::Addr(Addr::PStrLocation(threshold, 0));
|
||||||
|
|
||||||
self.scan += 1;
|
self.scan += 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user