Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Null pointers (and then UB) when creating two Sorts with the same name #313

Open
shelvacu opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@shelvacu
Copy link

shelvacu commented Oct 2, 2024

repro:

use z3::Sort;

fn main() {
    let cfg = z3::Config::new();
    let ctx = z3::Context::new(&cfg);

    let res1 = Sort::enumeration(
        &ctx,
        "SameNameSort".into(),
        &["A".into(), "B".into(),]
    );
    dbg!(&res1);
    let res2 = Sort::enumeration(
        &ctx,
        "SameNameSort".into(),
        &["C".into(), "D".into(),]
    );
    dbg!(&res2);
}

This manages to show the issue without triggering any UB, but doing anything interesting with res2 gives a nullptr exception

I'm not sure what exactly is supposed to happen, but at the very least this should panic!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant