-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: save the data bus to the current function before generating others
Otherwise the databus will be saved to the last generated function instead of the main function.
- Loading branch information
Showing
2 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
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
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,10 +1,12 @@ | ||
// Test unsafe integer multiplication with overflow: 12^8 = 429 981 696 | ||
// The circuit should handle properly the growth of the bit size | ||
use dep::std; | ||
|
||
fn main(mut x: u32, y: call_data u32, z: call_data [u32;4] ) -> return_data u32 { | ||
|
||
let a = z[x]; | ||
a+y | ||
fn main(mut x: u32, y: call_data u32, z: call_data [u32;4]) -> return_data u32 { | ||
let a = z[x]; | ||
a+foo(y) | ||
} | ||
|
||
// Use an unconstrained function to force the compiler to avoid inlining | ||
unconstrained fn foo(x: u32) -> u32 { | ||
x+1 | ||
} | ||
|