From: Mark Thom Date: Mon, 27 Jul 2020 01:16:05 +0000 (-0600) Subject: try to build strings from list as potential matches in SwitchOnConstant (#623) X-Git-Tag: v0.9.0~175 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=8dc07882b6b5b5cf94af2debeb413670daac13ab;p=scryer-prolog.git try to build strings from list as potential matches in SwitchOnConstant (#623) --- diff --git a/Cargo.lock b/Cargo.lock index 41c90cbd..041ddfa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,6 +51,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + [[package]] name = "bit-set" version = "0.5.2" @@ -1157,7 +1163,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" dependencies = [ - "base64", + "base64 0.11.0", "blake2b_simd", "constant_time_eq", "crossbeam-utils", @@ -1217,6 +1223,7 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" name = "scryer-prolog" version = "0.8.126" dependencies = [ + "base64 0.12.3", "blake2", "chrono", "cpu-time", diff --git a/src/machine/machine_indices.rs b/src/machine/machine_indices.rs index 735009f8..6407d3d1 100644 --- a/src/machine/machine_indices.rs +++ b/src/machine/machine_indices.rs @@ -272,9 +272,8 @@ impl Addr { &Addr::Float(f) => { Some(Constant::Float(f)) } - &Addr::PStrLocation(h, n) => { - let mut heap_pstr_iter = - machine_st.heap_pstr_iter(Addr::PStrLocation(h, n)); + addr @ &Addr::PStrLocation(..) | addr @ &Addr::Lis(_) => { + let mut heap_pstr_iter = machine_st.heap_pstr_iter(*addr); let buf = heap_pstr_iter.to_string(); let end_addr = heap_pstr_iter.focus();