Skip to content

audit:mir is clean on the compiler's own source (#692) - #3422

Merged
ehartford merged 1 commit into
mainfrom
audit-mir-error-type
Nov 18, 2026
Merged

ehartford merged 1 commit into
mainfrom
audit-mir-error-type

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

with analyze src/main.w audit:mir reported one violation on main, and a second when the zlib corpus is compiled from source. Both are fixed, and the audit gains the cell #692 asks for.

New cell (#692). A MIR local's type is a type of the table: the error type (0) or a slot that is no type id in a lowered body is a violation. None found.

A write to a place covers the places inside it. record.pending_link_command = replacement, just after one sub-field was moved out and the rest dropped, was reported as "frees … again" at the whole value's drop: mark_place updated the assigned field's own entry and left its sub-fields' entries as dropped. The source was sound (ComptimeEvaluator.eval_workspace_capability_method). Test: nested_field_rewrite_verdict.

A Copy receiver of a consuming builtin method is copied. It was marked move unless it had drop glue, so table[i].f.unwrap() on a global table of C function pointers (zlib's configuration_table[level].func.unwrap()) was a move out of a global, which D52 forbids. The program ran correctly; the MIR was invalid. Test: behav_copy_field_of_global_unwrap runs the program and audit:mir on it (fails before, passes after).

Checks: full build, :deep-debug-tool-tests, :drop-audit, battery, :release-checks all green. audit:mir on src/main.w with corpora from source: violations=0.

#692 stays open for its context rules (sub-byte integers, aliases).

…local's type must be a type of the table (no error type reaches MIR, #692); a write to a place covers the places inside it, so a field assigned whole after one of its sub-fields was dropped is not reported as freed twice (ComptimeEvaluator.eval_workspace_capability_method); a Copy receiver of a consuming builtin method is copied, so a Copy field of a global read through unwrap() is no move out of the global (D52; zlib's configuration_table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant