@@ -1392,22 +1392,21 @@ impl<'a> Context<'a> {
1392
1392
// Get operations to call-data parameters are replaced by a get to the call-data-bus array
1393
1393
let call_data =
1394
1394
self . data_bus . call_data . iter ( ) . find ( |cd| cd. index_map . contains_key ( & array) ) . cloned ( ) ;
1395
- if let Some ( call_data) = call_data {
1395
+ let mut value = if let Some ( call_data) = call_data {
1396
1396
let call_data_block = self . ensure_array_is_initialized ( call_data. array_id , dfg) ?;
1397
1397
let bus_index = self
1398
1398
. acir_context
1399
1399
. add_constant ( FieldElement :: from ( call_data. index_map [ & array] as i128 ) ) ;
1400
1400
let mut current_index = self . acir_context . add_var ( bus_index, var_index) ?;
1401
- let result = self . get_from_call_data ( & mut current_index, call_data_block, & res_typ) ?;
1402
- self . define_result ( dfg, instruction, result. clone ( ) ) ;
1403
- return Ok ( result) ;
1404
- }
1405
- // Compiler sanity check
1406
- assert ! (
1407
- !res_typ. contains_slice_element( ) ,
1408
- "ICE: Nested slice result found during ACIR generation"
1409
- ) ;
1410
- let mut value = self . array_get_value ( & res_typ, block_id, & mut var_index) ?;
1401
+ self . get_from_call_data ( & mut current_index, call_data_block, & res_typ) ?
1402
+ } else {
1403
+ // Compiler sanity check
1404
+ assert ! (
1405
+ !res_typ. contains_slice_element( ) ,
1406
+ "ICE: Nested slice result found during ACIR generation"
1407
+ ) ;
1408
+ self . array_get_value ( & res_typ, block_id, & mut var_index) ?
1409
+ } ;
1411
1410
1412
1411
if let AcirValue :: Var ( value_var, typ) = & value {
1413
1412
let array_typ = dfg. type_of_value ( array) ;
0 commit comments