compare complete strings to one another in write_literal_to_var (#1388)

This commit is contained in:
Mark Thom
2022-04-03 01:37:19 -06:00
parent d5fe2e88d1
commit 86176dce8d

View File

@@ -1989,20 +1989,23 @@ impl MachineState {
) )
} }
(HeapCellValueTag::CStr, cstr_atom) => { (HeapCellValueTag::CStr, cstr_atom) => {
match store_v.get_tag() { read_heap_cell!(store_v,
HeapCellValueTag::PStrLoc (HeapCellValueTag::PStrLoc
| HeapCellValueTag::Lis | HeapCellValueTag::Lis
| HeapCellValueTag::Str => { | HeapCellValueTag::Str) => {
self.match_partial_string(store_v, cstr_atom, false); self.match_partial_string(store_v, cstr_atom, false);
} }
HeapCellValueTag::AttrVar | HeapCellValueTag::Var => { (HeapCellValueTag::AttrVar | HeapCellValueTag::Var) => {
let r = store_v.as_var().unwrap(); let r = store_v.as_var().unwrap();
self.bind(r, lit); self.bind(r, lit);
} }
(HeapCellValueTag::CStr, cstr2_atom) => {
self.fail = cstr_atom != cstr2_atom;
}
_ => { _ => {
self.fail = true; self.fail = true;
} }
} );
} }
_ => { _ => {
unreachable!() unreachable!()