Skip to content

Commit

Permalink
fix: return variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
brech1 committed Feb 27, 2024
1 parent e5597e1 commit 5967eac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use crate::circuit::{AGateType, ArithmeticCircuit};
use crate::program::ProgramError;
use crate::runtime::{
increment_indices, u32_to_access, Context, DataAccess, DataType, Runtime, Signal, SubAccess,
RETURN_VAR,
generate_u32, increment_indices, u32_to_access, Context, DataAccess, DataType, Runtime, Signal,
SubAccess, RETURN_VAR,
};
use circom_circom_algebra::num_traits::ToPrimitive;
use circom_program_structure::ast::{
Expand Down Expand Up @@ -382,7 +382,8 @@ fn handle_call(
// Return to parent context
runtime.pop_context(false)?;
let ctx = runtime.current_context()?;
let return_access = DataAccess::new(&format!("{}_{}", id, RETURN_VAR), vec![]);
let return_access =
DataAccess::new(&format!("{}_{}_{}", id, RETURN_VAR, generate_u32()), vec![]);

if is_function {
ctx.declare_item(DataType::Variable, &return_access.get_name(), &[])?;
Expand Down

0 comments on commit 5967eac

Please sign in to comment.