Back to Ponyc

Partiality determines a method's vtable slot AND its calling convention

.known-couplings/partiality-vtable-slot.md

0.66.0713 B
Original Source

Partiality determines a method's vtable slot AND its calling convention

Two predicates must stay byte-identical: the partiality test in make_mangled_name (src/libponyc/reach/reach.c), which puts partial and non-partial methods in separate vtable slots, and the c_m->is_partial test in make_function_type (src/libponyc/codegen/genfun.c), which sets a slot's LLVM return convention ({T, i1} vs T). If they diverge, a method lands in a slot whose ABI doesn't match its body, a silent calling-convention bug in generated code. Relatedly, the _p partiality marker is collision-free only because no type mangle (t->mangle in reach.c) ends in 'p'; don't add one that does. Run: make test-core.