Skip to content

Panics in code are causing problems for me #1

@omarandlorraine

Description

@omarandlorraine

I appreciate that my project strop is unusual in that it needs to be able to run malformed code.

But here is where I am getting stuck:

thread 'main' (309758) panicked at /home/redacted/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/armagnac-0.3.0/src/arith.rs:57:5:
assertion failed: (shift > 0) && (shift < 32)

Here's what ARM docs say about shift values that are out of range:

This instruction shifts a register value right by a variable number of bits, shifting in copies of its sign bit, and writes the
result to the destination register. The value of the second source register modulo the register size in bits gives the number
of bits by which the first source register is right-shifted.

(DDI0487, Section C6.2.21)

So I'm not sure why this assert! is there. I understand that this operation would be undefined behaviour in C, but the ARM specification seems to define it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions