From 1b4184ef16c97e4c688b444eb76821035d96af96 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 9 Feb 2022 08:00:05 +0800 Subject: [PATCH] Run debugger with no optimization. --- CHANGELOG.md | 2 ++ src/bin/rhai-dbg.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4942004e..a09f3801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Version 1.5.0 This version adds a debugging interface, which can be used to integrate a debugger. +The `REPL` tool uses [`rustyline`](https://crates.io/crates/rustyline) for line editing and history. + Bug fixes --------- diff --git a/src/bin/rhai-dbg.rs b/src/bin/rhai-dbg.rs index 4b289985..263acee4 100644 --- a/src/bin/rhai-dbg.rs +++ b/src/bin/rhai-dbg.rs @@ -179,6 +179,9 @@ fn main() { // Initialize scripting engine let mut engine = Engine::new(); + #[cfg(not(feature = "no_optimize"))] + engine.set_optimization_level(rhai::OptimizationLevel::None); + let mut script = String::new(); let main_ast;