Map, Set, and Decimal parameters are pushed to the GC shadow stack (vera/codegen/functions.py line 120) even though they are i32 handle values, not heap pointers. This wastes shadow stack space and could cause false-positive retention if a handle value accidentally passes the heap-pointer heuristic (>= gc_heap_start + 4, aligned to 8 bytes).
Impact
- Shadow stack space is wasted on non-pointer values
- A handle value that happens to match the heap range and alignment would cause the GC to mark a random heap object as live, preventing its collection (memory leak, not corruption)
Possible fix
Exclude opaque handle types from the shadow stack push, similar to how Bool/Byte are handled. The compiler knows which parameters are opaque handles at codegen time.
Affects: Map, Set, Decimal, and any future opaque handle types (Json).
Map, Set, and Decimal parameters are pushed to the GC shadow stack (
vera/codegen/functions.pyline 120) even though they are i32 handle values, not heap pointers. This wastes shadow stack space and could cause false-positive retention if a handle value accidentally passes the heap-pointer heuristic (>= gc_heap_start + 4, aligned to 8 bytes).Impact
Possible fix
Exclude opaque handle types from the shadow stack push, similar to how Bool/Byte are handled. The compiler knows which parameters are opaque handles at codegen time.
Affects: Map, Set, Decimal, and any future opaque handle types (Json).