Skip to content

ACIR vs Brillig: Brillig failed on unreachable branch with shr #9583

@defkit

Description

@defkit

Aim

The following Noir code solved in ACIR and failed in Brillig

fn main(a: i32, condition: bool) -> pub bool {
  if condition {
    let _ = a << a;
  } else {
    if condition {
      let _ = a << a;
    }
  }
  condition
}
"condition" = false
"a" = 921483816

Expected Behavior

Brillig solved

Bug

nargo execute --force-brillig
error: Assertion failed: 'Attempted to shift by 921483816 bits on a type of bit size 8'
  ┌─ src/main.nr:6:15
  │
6 │       let _ = a << a;
  │               ------
  │
  = Call stack:
    1. src/main.nr:6:15

Failed assertion

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions