diff --git a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs index ec288a5cfd4..97de1aea8c7 100644 --- a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs +++ b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs @@ -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, ); diff --git a/compiler/noirc_evaluator/src/ssa/ir/dfg.rs b/compiler/noirc_evaluator/src/ssa/ir/dfg.rs index 6b6740c4d2e..8e87db15caf 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/dfg.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/dfg.rs @@ -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] {