mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
fix gen_refcount tests
This commit is contained in:
parent
ad76fa2a4e
commit
a8bef30392
3 changed files with 34 additions and 3 deletions
|
@ -310,7 +310,14 @@ where
|
|||
RefCount::Deallocated
|
||||
} else {
|
||||
// Dereference the RC pointer and decode its value from the negative number format
|
||||
let rc_encoded = read_i32(&inst.memory, rc_ptr);
|
||||
let mut rc_encoded = read_i32(&inst.memory, rc_ptr);
|
||||
if rc_encoded > 0 {
|
||||
// We happen to be reading a list that is refcounted.
|
||||
// This is the size on heap.
|
||||
// Shift over 4 to and load the real RC.
|
||||
rc_encoded = read_i32(&inst.memory, rc_ptr + 4);
|
||||
}
|
||||
|
||||
if rc_encoded == 0 {
|
||||
RefCount::Constant
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue