Skip to content

Commit

Permalink
fix: handle dfg databus in SSA normalization (#6249)
Browse files Browse the repository at this point in the history
# Description

## Problem

Resolves #6227

## Summary

## Additional Context

## Documentation

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
asterite authored Oct 9, 2024
1 parent f6a7306 commit 9d8bee5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/noirc_evaluator/src/ssa/opt/normalize_value_ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ impl Context {
terminator.mutate_blocks(|old_block| self.new_ids.blocks[&old_block]);
new_function.dfg.set_block_terminator(new_block_id, terminator);
}

// Also map the values in the databus
let old_databus = &old_function.dfg.data_bus;
new_function.dfg.data_bus = old_databus
.map_values(|old_value| self.new_ids.map_value(new_function, old_function, old_value));
}
}

Expand Down

0 comments on commit 9d8bee5

Please sign in to comment.