ffi issue-0049: new-form variadic cross-module LLVM crash — xfail lock-in

Migrating stdlib's `path_join` to the new variadic syntax
(`(..parts: []string) -> string`) surfaces a latent compiler bug:
`resolveParamType` and `packVariadicCallArgs` treat the new-form
declaration the same as the legacy `parts: ..string` and wrap the
element type in `sliceOf` regardless of whether it already is one.
The new form's `[]string` becomes `[][]string`; the call-site
marshal pack emits `[N x string]` (correct) but the callee stores
its slice param into a `[]([]string)`-typed slot. The shape
mismatch propagates as null/undef Refs that crash
`LLVMBuildExtractValue` inside `emitStrCmp` during emission.

`examples/121-ios-sim-bundle.sx` (existing) and the new focused
`examples/174-new-form-variadic-cross-module.sx` both fail today
with the segfault. The next commit fixes `resolveParamType` +
`packVariadicCallArgs` so both flip green. Stdlib's `format` /
`print` / `open` and the example fixtures stay on the legacy form
in this commit — they migrate in the follow-up cleanup commit.
This commit is contained in:
agra
2026-05-27 21:29:08 +03:00
parent 0ede0973f4
commit 64dcbca06a
5 changed files with 194 additions and 1 deletions

View File

@@ -191,7 +191,7 @@ xml_escape :: (s: string) -> string {
// components and collapses duplicate separators at component
// boundaries. Used for bundle paths where Apple .app and Android APK
// both expect POSIX-style paths.
path_join :: (parts: ..string) -> string {
path_join :: (..parts: []string) -> string {
result := "";
i := 0;
while i < parts.len {