Skip to content

audit:all: BTreeMap.key_at marshaled LLVM type disagrees with FnAbi on for (k, v) in a BTreeMap #1740

Closed

Description

@ehartford

with analyze … audit:all reports a FnAbi marshalling violation for BTreeMap traversal (main's installed compiler and gen-push-impl):

use std.collections.{BTreeMap}
fn main:
    let names: BTreeMap[i32, str] = [x: (if x == 1: "ten" else: "thirty") for x in 0..4 if x > 0]
    var mtext = "map"
    for (k, v) in names:
        mtext = mtext ++ f" {k}:{v}"
    print(mtext)
violation: call BTreeMap.key_at__receiver__468_3_16 body=1069 args=1 param=1: marshaled LLVM type disagrees with FnAbi
compiler-analysis-audit: facts=13928 violations=1 FAILED

The program runs correctly; the audit says caller marshalling and the callee's FnAbi disagree for key_at's index parameter (D6: never re-derive call ABI per path). Found while auditing behav_gen_push_comprehension.w (gen-push-fixes).

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