Open
Description
The test file-tests/should-lower/hoist.fuse fails typecheck as there is an out of bounds access let w = b[10 * 12];
. However when --lower
is present it seems to pass.
decl a: bit<32>[1];
decl b: bit<32>[1];
// Recusively hoist nested reads
let x = a[b[0]];
---
// Hoist binary expressions with reads
let y = 10 + a[0];
// Recusively hoist slow ops
let z = (x * 10) / (y * 20 - 15);
// Recursively hoist slow index expressions
let w = b[10 * 12];
// Complex chained binary expression
let k = (((0-1) * 1 + (2*2) * 2 - 1*1 - 1*2) as ubit<32>);
Error without --lower
[WARN] [5.11] bit<32> is used for an array access. This might be out of bounds at runtime.
let x = a[b[0]];
^
[Type error] [Line 15, Column 11] Index out of bounds for `b'. Memory size is 1, iterator max val is 120
let w = b[10 * 12];
^
Metadata
Metadata
Assignees
Labels
No labels