From: Mark Thom Date: Wed, 20 Nov 2019 14:50:33 +0000 (-0400) Subject: avoid overwriting IndexPtr's for clauses already declared dynamic (#227) X-Git-Tag: v0.8.118~38^2~13 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=f82c6f3fedce809b471672e4eac7eabc30a72272;p=scryer-prolog.git avoid overwriting IndexPtr's for clauses already declared dynamic (#227) --- diff --git a/Cargo.lock b/Cargo.lock index 75f81231..dcef9728 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,7 +261,7 @@ dependencies = [ [[package]] name = "prolog_parser" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lexical 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -395,7 +395,7 @@ dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "prolog_parser 0.8.34 (registry+https://github.com/rust-lang/crates.io-index)", + "prolog_parser 0.8.35 (registry+https://github.com/rust-lang/crates.io-index)", "ref_thread_local 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rug 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustyline 5.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -533,7 +533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7eb5259643245d3f292c7a146b2df53bba24d7eab159410e648eb73dc164669d" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum prolog_parser 0.8.34 (registry+https://github.com/rust-lang/crates.io-index)" = "3aa04502f866acaf7b448890160fba0437eb399058f984ff896a6c8ec52399a5" +"checksum prolog_parser 0.8.35 (registry+https://github.com/rust-lang/crates.io-index)" = "1bc16334ea998d54f73cda14254fe546c57ae0c6c990263d50f7efd6ae10ea9d" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" diff --git a/src/prolog/machine/compile.rs b/src/prolog/machine/compile.rs index 0f959a6e..55a916bf 100644 --- a/src/prolog/machine/compile.rs +++ b/src/prolog/machine/compile.rs @@ -824,8 +824,9 @@ impl ListingCompiler { .entry((name.clone(), arity)) .or_insert(vec![]); - indices.code_dir.insert((name.clone(), arity), - CodeIndex::dynamic_undefined(self.get_module_name())); + indices.code_dir + .entry((name.clone(), arity)) + .or_insert(CodeIndex::dynamic_undefined(self.get_module_name())); } &Declaration::Hook(hook, _, ref queue) if self.module.is_none() => worker .term_stream