Skip to content

Commit

Permalink
fix(ssa): Resolve value before fetching from DFG in a couple cases (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm authored Jan 23, 2025
1 parent 8cab0e4 commit 39af02f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,8 @@ impl<'block, Registers: RegisterAllocator> BrilligBlock<'block, Registers> {
result_variable: SingleAddrVariable,
) {
let binary_type = type_of_binary_operation(
dfg[binary.lhs].get_type().as_ref(),
dfg[binary.rhs].get_type().as_ref(),
dfg[dfg.resolve(binary.lhs)].get_type().as_ref(),
dfg[dfg.resolve(binary.rhs)].get_type().as_ref(),
binary.operator,
);

Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/ir/dfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ impl DataFlowGraph {
/// Should `value` be a numeric constant then this function will return the exact number of bits required,
/// otherwise it will return the minimum number of bits based on type information.
pub(crate) fn get_value_max_num_bits(&self, value: ValueId) -> u32 {
match self[value] {
match self[self.resolve(value)] {
Value::Instruction { instruction, .. } => {
let value_bit_size = self.type_of_value(value).bit_size();
if let Instruction::Cast(original_value, _) = self[instruction] {
Expand Down

0 comments on commit 39af02f

Please sign in to comment.