fix refcount bug

closures were not incremented, but were decremented. This lead to memory corruption
This commit is contained in:
Folkert 2020-12-13 19:57:51 +01:00
parent 30e3f3bd25
commit f00bd9ba01
5 changed files with 217 additions and 23 deletions

View file

@ -587,7 +587,10 @@ impl<'a> Procs<'a> {
let symbol = name;
// TODO should pending_procs hold a Rc<Proc>?
let partial_proc = self.partial_procs.get(&symbol).unwrap().clone();
let partial_proc = match self.partial_procs.get(&symbol) {
Some(p) => p.clone(),
None => panic!("no partial_proc for {:?}", symbol),
};
// Mark this proc as in-progress, so if we're dealing with
// mutually recursive functions, we don't loop forever.