-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(brillig): Fix brillig radix instruction return vector size (#2350)
- Loading branch information
Showing
3 changed files
with
14 additions
and
26 deletions.
There are no files selected for viewing
15 changes: 7 additions & 8 deletions
15
crates/nargo_cli/tests/execution_success/brillig_to_le_bytes/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
use dep::std; | ||
|
||
unconstrained fn main(x : Field) -> pub [u8; 4] { | ||
unconstrained fn main(x : Field) -> pub [u8; 31] { | ||
// The result of this byte array will be little-endian | ||
let byte_array = x.to_le_bytes(31); | ||
let mut first_four_bytes = [0; 4]; | ||
for i in 0..4 { | ||
first_four_bytes[i] = byte_array[i]; | ||
assert(byte_array.len() == 31); | ||
|
||
let mut bytes = [0; 31]; | ||
for i in 0..31 { | ||
bytes[i] = byte_array[i]; | ||
} | ||
// Issue #617 fix | ||
// We were incorrectly mapping our output array from bit decomposition functions during acir generation | ||
first_four_bytes[3] = byte_array[31]; | ||
first_four_bytes | ||
bytes | ||
} |
15 changes: 7 additions & 8 deletions
15
crates/nargo_cli/tests/execution_success/to_le_bytes/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
use dep::std; | ||
|
||
fn main(x : Field) -> pub [u8; 4] { | ||
fn main(x : Field) -> pub [u8; 31] { | ||
// The result of this byte array will be little-endian | ||
let byte_array = x.to_le_bytes(31); | ||
let mut first_four_bytes = [0; 4]; | ||
for i in 0..4 { | ||
first_four_bytes[i] = byte_array[i]; | ||
assert(byte_array.len() == 31); | ||
|
||
let mut bytes = [0; 31]; | ||
for i in 0..31 { | ||
bytes[i] = byte_array[i]; | ||
} | ||
// Issue #617 fix | ||
// We were incorrectly mapping our output array from bit decomposition functions during acir generation | ||
first_four_bytes[3] = byte_array[31]; | ||
first_four_bytes | ||
bytes | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters