]> Repositorios git - scryer-prolog.git/commitdiff
compare complete strings to one another in write_literal_to_var (#1388)
authorMark Thom <[email protected]>
Sun, 3 Apr 2022 07:37:19 +0000 (01:37 -0600)
committerMark Thom <[email protected]>
Sun, 3 Apr 2022 07:37:19 +0000 (01:37 -0600)
src/machine/machine_state_impl.rs

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