Skip to content

ABI audit accepts an undefined call target when a default method is omitted #1119

Closed

Description

@ehartford

with analyze wide.w audit:all --no-prelude reports facts=615 violations=0 while the resulting IR calls an undefined function pointer. This was found while completing #1106.

Reproduction: define a default trait method taking self: &Self and 65 Large parameters, implement it for a concrete type, and call it. Large is a Copy struct of four i64 fields; the method returns its last argument. The fixture generator in test/behavior/behav_fn_abi_callable.w now covers this shape.

The runtime defect is fixed in the FnAbi batch: Codegen.generate_default_trait_method_for_impl silently returned at if param_count < 0 or param_count > 64. LLDB observed w8=66 at +1052 (cmp w8, #0x40) and the following branch returning without generating the method. The descriptor and its vectors have no such limit. Generated IR then contained call %Large undef(ptr undef, ...) and an empty vtable; LLVM's structural verifier and the With audit both accepted it.

Expected under D6 and the no-silent-fallback rule: a missing resolved callee is a hard compiler error, and analysis rejects undefined/poison call targets and missing concrete vtable entries. The call-argument audit checks marshalling but does not establish a valid callee exists. Add target coverage, including zero-argument calls. No user-source workaround is used; the batch removes the obsolete limit and adds native execution plus five-target coverage.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced in source as a coverage gap. The undefined-callee codegen is fixed (936c1a0), and no check in src/Analysis*.w verifies that every LLVM call target is defined, so the audit would still pass the old IR.

    post-release: audit coverage with no live defect behind it.

  2. added this to the post-v0.16.0 milestone on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions