mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
fix refcount bug
closures were not incremented, but were decremented. This lead to memory corruption
This commit is contained in:
parent
30e3f3bd25
commit
f00bd9ba01
5 changed files with 217 additions and 23 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue