Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion compiler/noirc_evaluator/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ pub enum RuntimeError {
"Only constant indices are supported when indexing an array containing reference values"
)]
DynamicIndexingWithReference { call_stack: CallStack },
#[error(
"Calling constrained function '{constrained}' from the unconstrained function '{unconstrained}'"
)]
UnconstrainedCallingConstrained {
call_stack: CallStack,
constrained: String,
unconstrained: String,
},
}

#[derive(Debug, Clone, Serialize, Deserialize, Hash)]
Expand Down Expand Up @@ -198,7 +206,8 @@ impl RuntimeError {
| RuntimeError::BreakOrContinue { call_stack }
| RuntimeError::DynamicIndexingWithReference { call_stack }
| RuntimeError::UnknownReference { call_stack }
| RuntimeError::RecursionLimit { call_stack, .. } => call_stack,
| RuntimeError::RecursionLimit { call_stack, .. }
| RuntimeError::UnconstrainedCallingConstrained { call_stack, .. } => call_stack,
}
}
}
Expand Down
1 change: 0 additions & 1 deletion compiler/noirc_evaluator/src/ssa/function_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ impl FunctionBuilder {
}

/// Insert a numeric constant into the current function of type Field
#[cfg(test)]
pub fn field_constant(&mut self, value: impl Into<FieldElement>) -> ValueId {
self.numeric_constant(value.into(), NumericType::NativeField)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn primary_passes(options: &SsaEvaluatorOptions) -> Vec<SsaPass<'_>> {
SsaPass::new(Ssa::expand_signed_checks, "expand signed checks"),
SsaPass::new(Ssa::remove_unreachable_functions, "Removing Unreachable Functions"),
SsaPass::new(Ssa::defunctionalize, "Defunctionalization"),
SsaPass::new(Ssa::inline_simple_functions, "Inlining simple functions")
SsaPass::new_try(Ssa::inline_simple_functions, "Inlining simple functions")
.and_then(Ssa::remove_unreachable_functions),
// BUG: Enabling this mem2reg causes an integration test failure in aztec-package; see:
// https://github.com/AztecProtocol/aztec-packages/pull/11294#issuecomment-2622809518
Expand Down
Loading
Loading