Skip to content

Commit

Permalink
fix: prevent panic within remove_possibly_mutated_cached_make_arrays (
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Feb 3, 2025
1 parent 0b6c382 commit 130d991
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/noirc_evaluator/src/ssa/opt/constant_folding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,11 @@ impl<'brillig> Context<'brillig> {

// Should we consider calls to slice_push_back and similar to be mutating operations as well?
if let Store { value: array, .. } | ArraySet { array, .. } = instruction {
if function.dfg.is_global(*array) {
// Early return as we expect globals to be immutable.
return;
};

let instruction = match &function.dfg[*array] {
Value::Instruction { instruction, .. } => &function.dfg[*instruction],
_ => return,
Expand Down

2 comments on commit 130d991

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 130d991 Previous: 0b6c382 Ratio
noir-lang_schnorr_ 1 s 0 s +∞
noir-lang_noir_string_search_ 1 s 0 s +∞
noir-lang_noir_check_shuffle_ 1 s 0 s +∞
noir-lang_eddsa_ 2 s 1 s 2
noir-lang_ec_ 1 s 0 s +∞

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 130d991 Previous: 0b6c382 Ratio
noir-lang_sparse_array_ 2 s 1 s 2
noir-lang_schnorr_ 1 s 0 s +∞
noir-lang_noir_string_search_ 1 s 0 s +∞
noir-lang_noir_base64_ 2 s 1 s 2

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Please sign in to comment.