This PR fixes the compilation of structure projections with unboxed arguments marked `extern`, adding missing `dec` instructions. It led to leaking single allocations when such functions were used as closures or in the interpreter. This is the minimal working fix; `extern` should not replicate parts of the compilation pipeline, which will be possible via #10291.
8 lines
353 B
Text
8 lines
353 B
Text
[Compiler.IR] [result]
|
|
extern _private.lean.externBoxing.0.Foo.bar (x_0 : obj) (x_1 : u64) : u64
|
|
def _private.lean.externBoxing.0.Foo.bar._boxed (x_1 : obj) (x_2 : tobj) : tobj :=
|
|
let x_3 : u64 := unbox x_2;
|
|
dec x_2;
|
|
let x_4 : u64 := _private.lean.externBoxing.0.Foo.bar x_1 x_3;
|
|
let x_5 : tobj := box x_4;
|
|
ret x_5
|