dereference car of Lis in HeapPStRIter::step (#1238)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
use crate::atom_table::*;
|
use crate::atom_table::*;
|
||||||
use crate::parser::ast::*;
|
use crate::parser::ast::*;
|
||||||
|
|
||||||
|
use crate::machine::heap::*;
|
||||||
use crate::machine::machine_errors::CycleSearchResult;
|
use crate::machine::machine_errors::CycleSearchResult;
|
||||||
use crate::machine::system_calls::BrentAlgState;
|
use crate::machine::system_calls::BrentAlgState;
|
||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
@@ -296,7 +297,12 @@ impl<'a> HeapPStrIter<'a> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
(HeapCellValueTag::Lis, h) => {
|
(HeapCellValueTag::Lis, h) => {
|
||||||
return if let Some(c) = self.heap[h].as_char() {
|
let value = heap_bound_store(
|
||||||
|
self.heap,
|
||||||
|
heap_bound_deref(self.heap, self.heap[h]),
|
||||||
|
);
|
||||||
|
|
||||||
|
return if let Some(c) = value.as_char() {
|
||||||
Some(PStrIterStep {
|
Some(PStrIterStep {
|
||||||
iteratee: PStrIteratee::Char(curr_hare, c),
|
iteratee: PStrIteratee::Char(curr_hare, c),
|
||||||
next_hare: h+1,
|
next_hare: h+1,
|
||||||
@@ -310,7 +316,12 @@ impl<'a> HeapPStrIter<'a> {
|
|||||||
.get_name_and_arity();
|
.get_name_and_arity();
|
||||||
|
|
||||||
return if name == atom!(".") && arity == 2 {
|
return if name == atom!(".") && arity == 2 {
|
||||||
if let Some(c) = self.heap[s+1].as_char() {
|
let value = heap_bound_store(
|
||||||
|
self.heap,
|
||||||
|
heap_bound_deref(self.heap, self.heap[s+1]),
|
||||||
|
);
|
||||||
|
|
||||||
|
if let Some(c) = value.as_char() {
|
||||||
Some(PStrIterStep {
|
Some(PStrIterStep {
|
||||||
iteratee: PStrIteratee::Char(curr_hare, c),
|
iteratee: PStrIteratee::Char(curr_hare, c),
|
||||||
next_hare: s+2,
|
next_hare: s+2,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ fn rules() {
|
|||||||
fn setup_call_cleanup_load() {
|
fn setup_call_cleanup_load() {
|
||||||
load_module_test(
|
load_module_test(
|
||||||
"src/tests/setup_call_cleanup.pl",
|
"src/tests/setup_call_cleanup.pl",
|
||||||
"1+21+31+2>_14313+_143141+_129071+2>41+2>_143141+2>31+2>31+2>4ba"
|
"1+21+31+2>_14219+_142201+_128131+2>41+2>_142201+2>31+2>31+2>4ba"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ fn setup_call_cleanup_process() {
|
|||||||
run_top_level_test_with_args(
|
run_top_level_test_with_args(
|
||||||
&["src/tests/setup_call_cleanup.pl", "-f", "-g", "halt"],
|
&["src/tests/setup_call_cleanup.pl", "-f", "-g", "halt"],
|
||||||
"",
|
"",
|
||||||
"1+21+31+2>_15712+_157131+_143061+2>41+2>_157131+2>31+2>31+2>4ba",
|
"1+21+31+2>_15618+_156191+_142121+2>41+2>_156191+2>31+2>31+2>4ba"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user