Skip to content

analyze silently ignores --target and audits the host ABI #1105

Closed

Description

@ehartford

with analyze repro.w audit:all --target=linux_x86_64 silently audits the host target. Found while verifying #1104; this can report green on the wrong ABI.

Reproduction on Darwin arm64:

extern fn va_probe(args: c_va_list) -> i32
pub unsafe fn forward(args: c_va_list) -> i32: va_probe(args)

With the pending #1104 compiler, ir repro.w --target=linux_x86_64 --no-prelude emits a 24-byte va_list and an indirect-place argument. analyze repro.w 'matrix:name~va_probe' --target=linux_x86_64 --no-prelude instead reports value-ref=0 and direct-value; audit:all reports 85 facts, zero violations.

Exact cause: src/main.w, run_cli, the analyze branch configures Compilation but never calls driver_parse_build_target / set_target_kind. The adjacent ir branch does both. LLDB stopped in Compilation.analyze_file, called from run_cli+60776 (PC 0x1007efebc in the local pre-rebase va-list stage2). Its preceding calls are Compilation.set_link_bundles and cli_analysis_request, without target parsing/configuration. Log: /tmp/with-va-analyze-target-lldb.txt.

Expected: analyze honors and validates the requested target, and its matrix/audits describe the same ABI as ir --target. Invalid target spellings must fail rather than fall back to host.

Current verification uses explicit ir --target and LLDB; the host-only analysis verdict is not evidence for a foreign target. The tool fix should add a cross-target regression and invalid-target check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions