Skip to content

Verification fails when comparing arrays and string slices. #356

@bdalrhm

Description

@bdalrhm

I tried this code:

fn main() {
    assert!([1, 2, 3] < [1, 3, 4]);
    assert!("World" >= "Hello");
}

using the following command line invocation:

rmc test.rs

with RMC version: 6962a67

I expected to see this happen: verification succeeds.

Instead, this happened: verification failed with the following assertions failures:

[_RNvYSlNtNtCsgWci0eQkB8o_4core3cmp10PartialOrd2ltCs8ZdcvQGSn7l_4test.overflow.1] line 1018 arithmetic overflow on signed - in *((signed char *)((unsigned char *)&var_3 + 0)) - 2: FAILURE
[_RNvYSlNtNtCsgWci0eQkB8o_4core3cmp10PartialOrd2ltCs8ZdcvQGSn7l_4test.overflow.2] line 1018 arithmetic overflow on signed to unsigned type conversion in (unsigned long int)(*((signed char *)((unsigned char *)&var_3 + 0)) - 2): FAILURE
[_RNvYeNtNtCsgWci0eQkB8o_4core3cmp10PartialOrd2geCs8ZdcvQGSn7l_4test.overflow.2] line 1078 arithmetic overflow on signed to unsigned type conversion in (unsigned long int)(*((signed char *)((unsigned char *)&var_3 + 0)) - 2): FAILURE
[main.assertion.1] line 2 assertion failed: [1, 2, 3] < [1, 3, 4]: FAILURE

Metadata

Metadata

Assignees

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