| ... | ... | @@ -2841,12 +2841,12 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 2841 | 2841 | case BinOpTypeDiv: |
| 2842 | 2842 | case BinOpTypeMod: |
| 2843 | 2843 | { |
| 2844 | | AstNode *op1 = node->data.bin_op_expr.op1; |
| 2845 | | AstNode *op2 = node->data.bin_op_expr.op2; |
| 2846 | | TypeTableEntry *lhs_type = analyze_expression(g, import, context, expected_type, op1); |
| 2847 | | TypeTableEntry *rhs_type = analyze_expression(g, import, context, expected_type, op2); |
| 2844 | AstNode **op1 = node->data.bin_op_expr.op1->parent_field; |
| 2845 | AstNode **op2 = node->data.bin_op_expr.op2->parent_field; |
| 2846 | TypeTableEntry *lhs_type = analyze_expression(g, import, context, expected_type, *op1); |
| 2847 | TypeTableEntry *rhs_type = analyze_expression(g, import, context, expected_type, *op2); |
| 2848 | 2848 | |
| 2849 | | AstNode *op_nodes[] = {op1, op2}; |
| 2849 | AstNode *op_nodes[] = {*op1, *op2}; |
| 2850 | 2850 | TypeTableEntry *op_types[] = {lhs_type, rhs_type}; |
| 2851 | 2851 | |
| 2852 | 2852 | TypeTableEntry *resolved_type = resolve_peer_type_compatibility(g, import, context, node, |
| ... | ... | @@ -2856,32 +2856,32 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 2856 | 2856 | return resolved_type; |
| 2857 | 2857 | } |
| 2858 | 2858 | |
| 2859 | | ConstExprValue *op1_val = &get_resolved_expr(op1)->const_val; |
| 2860 | | ConstExprValue *op2_val = &get_resolved_expr(op2)->const_val; |
| 2859 | ConstExprValue *op1_val = &get_resolved_expr(*op1)->const_val; |
| 2860 | ConstExprValue *op2_val = &get_resolved_expr(*op2)->const_val; |
| 2861 | 2861 | if (!op1_val->ok || !op2_val->ok) { |
| 2862 | 2862 | return resolved_type; |
| 2863 | 2863 | } |
| 2864 | 2864 | |
| 2865 | 2865 | if (bin_op_type == BinOpTypeAdd) { |
| 2866 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_add, op1, op2, resolved_type); |
| 2866 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_add, *op1, *op2, resolved_type); |
| 2867 | 2867 | } else if (bin_op_type == BinOpTypeSub) { |
| 2868 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_sub, op1, op2, resolved_type); |
| 2868 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_sub, *op1, *op2, resolved_type); |
| 2869 | 2869 | } else if (bin_op_type == BinOpTypeMult) { |
| 2870 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_mul, op1, op2, resolved_type); |
| 2870 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_mul, *op1, *op2, resolved_type); |
| 2871 | 2871 | } else if (bin_op_type == BinOpTypeDiv) { |
| 2872 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_div, op1, op2, resolved_type); |
| 2872 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_div, *op1, *op2, resolved_type); |
| 2873 | 2873 | } else if (bin_op_type == BinOpTypeMod) { |
| 2874 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_mod, op1, op2, resolved_type); |
| 2874 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_mod, *op1, *op2, resolved_type); |
| 2875 | 2875 | } else if (bin_op_type == BinOpTypeBinOr) { |
| 2876 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_or, op1, op2, resolved_type); |
| 2876 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_or, *op1, *op2, resolved_type); |
| 2877 | 2877 | } else if (bin_op_type == BinOpTypeBinAnd) { |
| 2878 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_and, op1, op2, resolved_type); |
| 2878 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_and, *op1, *op2, resolved_type); |
| 2879 | 2879 | } else if (bin_op_type == BinOpTypeBinXor) { |
| 2880 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_xor, op1, op2, resolved_type); |
| 2880 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_xor, *op1, *op2, resolved_type); |
| 2881 | 2881 | } else if (bin_op_type == BinOpTypeBitShiftLeft) { |
| 2882 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_shl, op1, op2, resolved_type); |
| 2882 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_shl, *op1, *op2, resolved_type); |
| 2883 | 2883 | } else if (bin_op_type == BinOpTypeBitShiftRight) { |
| 2884 | | return resolve_expr_const_val_as_bignum_op(g, node, bignum_shr, op1, op2, resolved_type); |
| 2884 | return resolve_expr_const_val_as_bignum_op(g, node, bignum_shr, *op1, *op2, resolved_type); |
| 2885 | 2885 | } else { |
| 2886 | 2886 | zig_unreachable(); |
| 2887 | 2887 | } |