forked from AbleOS/holey-bytes
missing scoping
This commit is contained in:
parent
be2d38a6d2
commit
33d78fbc52
|
@ -2971,6 +2971,7 @@ impl<'a> Codegen<'a> {
|
||||||
}
|
}
|
||||||
Expr::Block { stmts, .. } => {
|
Expr::Block { stmts, .. } => {
|
||||||
let base = self.ci.scope.vars.len();
|
let base = self.ci.scope.vars.len();
|
||||||
|
let aclass_base = self.ci.scope.aclasses.len();
|
||||||
|
|
||||||
let mut ret = Some(Value::VOID);
|
let mut ret = Some(Value::VOID);
|
||||||
for stmt in stmts {
|
for stmt in stmts {
|
||||||
|
@ -2986,6 +2987,10 @@ impl<'a> Codegen<'a> {
|
||||||
var.remove(&mut self.ci.nodes);
|
var.remove(&mut self.ci.nodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for aclass in self.ci.scope.aclasses.drain(aclass_base..) {
|
||||||
|
aclass.remove(&mut self.ci.nodes);
|
||||||
|
}
|
||||||
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
Expr::Loop { body, .. } => {
|
Expr::Loop { body, .. } => {
|
||||||
|
@ -3481,6 +3486,10 @@ impl<'a> Codegen<'a> {
|
||||||
.vars
|
.vars
|
||||||
.drain(loob.scope.vars.len()..)
|
.drain(loob.scope.vars.len()..)
|
||||||
.for_each(|v| v.remove(&mut self.ci.nodes));
|
.for_each(|v| v.remove(&mut self.ci.nodes));
|
||||||
|
loob.ctrl_scope[id]
|
||||||
|
.aclasses
|
||||||
|
.drain(loob.scope.aclasses.len()..)
|
||||||
|
.for_each(|v| v.remove(&mut self.ci.nodes));
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in a new issue