+6
CHANGELOG.md
+6
CHANGELOG.md
···
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8
+
## v0.10.5 -- 2023-06-26
9
+
10
+
#### Fixed
11
+
12
+
- A panic that sometimes occurred in lazy execution mode.
13
+
14
## v0.10.4 -- 2023-06-02
15
16
### Library
+1
-1
Cargo.toml
+1
-1
Cargo.toml
+14
-6
src/execution/lazy/store.rs
+14
-6
src/execution/lazy/store.rs
···
193
) -> Result<HashMap<SyntaxNodeID, LazyValue>, ExecutionError> {
194
match values {
195
ScopedValues::Unforced(pairs) => {
196
-
let mut map = HashMap::new();
197
let mut debug_infos = HashMap::new();
198
for (scope, value, debug_info) in pairs.into_iter() {
199
let node = scope
200
.evaluate_as_syntax_node(exec)
201
.with_context(|| format!("Evaluating scope of variable _.{}", name,).into())
202
.with_context(|| debug_info.0.clone().into())?;
203
-
let prev_debug_info = debug_infos.insert(node, debug_info.clone());
204
-
match map.insert(node.index, value.clone()) {
205
-
Some(_) => {
206
return Err(ExecutionError::DuplicateVariable(format!(
207
"{}.{}",
208
node, name,
209
)))
210
-
.with_context(|| (prev_debug_info.unwrap().0, debug_info.0).into());
211
}
212
_ => {}
213
};
214
}
215
-
Ok(map)
216
}
217
ScopedValues::Forcing => Err(ExecutionError::RecursivelyDefinedScopedVariable(
218
format!("_.{}", name),
···
193
) -> Result<HashMap<SyntaxNodeID, LazyValue>, ExecutionError> {
194
match values {
195
ScopedValues::Unforced(pairs) => {
196
+
let mut values = HashMap::new();
197
let mut debug_infos = HashMap::new();
198
for (scope, value, debug_info) in pairs.into_iter() {
199
let node = scope
200
.evaluate_as_syntax_node(exec)
201
.with_context(|| format!("Evaluating scope of variable _.{}", name,).into())
202
.with_context(|| debug_info.0.clone().into())?;
203
+
match (
204
+
values.insert(node.index, value.clone()),
205
+
debug_infos.insert(node.index, debug_info.clone()),
206
+
) {
207
+
(Some(_), Some(prev_debug_info)) => {
208
return Err(ExecutionError::DuplicateVariable(format!(
209
"{}.{}",
210
node, name,
211
)))
212
+
.with_context(|| (prev_debug_info.0, debug_info.0).into());
213
+
}
214
+
(Some(_), None) => {
215
+
unreachable!(
216
+
"previous value for syntax node {} without previous debug info",
217
+
node
218
+
)
219
}
220
_ => {}
221
};
222
}
223
+
Ok(values)
224
}
225
ScopedValues::Forcing => Err(ExecutionError::RecursivelyDefinedScopedVariable(
226
format!("_.{}", name),