correct failed partial string matching (#483)

This commit is contained in:
Mark Thom
2020-05-10 14:00:49 -06:00
parent c5057127ee
commit 50c0abc786

View File

@@ -796,7 +796,7 @@ impl MachineState {
if let Some(var) = addr.as_var() { if let Some(var) = addr.as_var() {
self.bind(var, Addr::EmptyList); self.bind(var, Addr::EmptyList);
} else { } else {
self.fail = true; self.fail = addr != Addr::EmptyList;
} }
} }
} }
@@ -804,9 +804,7 @@ impl MachineState {
} }
Some(prefix_len) => { Some(prefix_len) => {
match heap_pstr_iter.focus() { match heap_pstr_iter.focus() {
addr @ Addr::AttrVar(_) | addr if addr.is_ref() => {
addr @ Addr::StackCell(..) |
addr @ Addr::HeapCell(_) => {
let h = self.heap.h(); let h = self.heap.h();
let pstr_addr = let pstr_addr =