]> Repositorios git - scryer-prolog.git/commitdiff
fix dif/2 crash (#1378)
authorMark Thom <[email protected]>
Wed, 30 Mar 2022 00:39:45 +0000 (18:39 -0600)
committerMark Thom <[email protected]>
Wed, 30 Mar 2022 00:39:45 +0000 (18:39 -0600)
src/machine/machine_state_impl.rs

index 7a90f88f62b7c541a10925656081e6bbbf411d98..f57898780c9c8ee328280a42cab7e87d166ac346 100644 (file)
@@ -1621,10 +1621,13 @@ impl MachineState {
                         );
 
                         let c2 = stalled_iter.heap[l];
-                        let c1 = string_iter.chars().next().unwrap();
+                        let c1 = match string_iter.chars().next() {
+                            Some(c) => char_as_cell!(c),
+                            None => string_iter.focus,
+                        };
 
                         pdl.push(c2);
-                        pdl.push(char_as_cell!(c1));
+                        pdl.push(c1);
 
                         None
                     }