mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
fixed specialisation box
This commit is contained in:
parent
ffc19ec2a2
commit
8f022d4310
2 changed files with 6 additions and 9 deletions
|
@ -958,23 +958,20 @@ fn specialize_boxed<'a, 'i>(
|
|||
*symbol,
|
||||
// If the symbol is unique:
|
||||
// - free the box
|
||||
|_, _, _| {
|
||||
|_, _, continuation| {
|
||||
arena.alloc(Stmt::Refcounting(
|
||||
// TODO can be replaced by free if ever added to the IR.
|
||||
ModifyRc::DecRef(*symbol),
|
||||
new_continuation,
|
||||
continuation,
|
||||
))
|
||||
},
|
||||
// If the symbol is not unique:
|
||||
// - increment the child
|
||||
// - decref the box
|
||||
|_, _, _| {
|
||||
|_, _, continuation| {
|
||||
arena.alloc(Stmt::Refcounting(
|
||||
ModifyRc::Inc(s, 1),
|
||||
arena.alloc(Stmt::Refcounting(
|
||||
ModifyRc::DecRef(*symbol),
|
||||
new_continuation,
|
||||
)),
|
||||
arena.alloc(Stmt::Refcounting(ModifyRc::DecRef(*symbol), continuation)),
|
||||
))
|
||||
},
|
||||
new_continuation,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue