Skip to content

Kani generates int constants that cannot fit into their bitwidth on some regressions #996

@danielsn

Description

@danielsn

Enabling the assertion in here causes a whole bunch of regression failures.

    pub fn int_constant<T>(i: T, typ: Type) -> Self
    where
        T: Into<BigInt>,
    {
        assert!(typ.is_integer());
        let i = i.into();
        //TODO: This check fails on some regressions
        // if i != 0 && i != 1 {
        //     assert!(
        //         typ.min_int() <= i && i <= typ.max_int(),
        //         "{} {} {} {:?}",
        //         i,
        //         typ.min_int(),
        //         typ.max_int(),
        //         typ
        //     );
        // }
        expr!(IntConstant(i), typ)
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BugThis is a bug. Something isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions