fix for init stmt scope

This commit is contained in:
Masato Imai
2022-08-23 10:57:50 +09:00
parent d88339c6ee
commit 1ffbf1a8cb

View File

@ -629,6 +629,16 @@ impl GPSL {
update, update,
stmt, stmt,
} => { } => {
let accept = self.blocks.front().unwrap().accept.clone();
let reject = self.blocks.front().unwrap().reject.clone();
self.blocks.push_front(Block {
accept,
reject,
variables: HashMap::new(),
is_split: false,
});
match init { match init {
Some(init) => { Some(init) => {
self.evaluate(init)?; self.evaluate(init)?;
@ -672,6 +682,12 @@ impl GPSL {
}; };
} }
let p = self.blocks.pop_front();
if let Some(p) = p {
debug!("Free: {}", p.variables.len());
}
return Ok(None); return Ok(None);
} }
Node::Block { Node::Block {