| ... | @@ -5527,7 +5527,7 @@ static IrInstSrc *ir_gen_merge_err_sets(IrBuilderSrc *irb, Scope *scope, AstNode | ... | @@ -5527,7 +5527,7 @@ static IrInstSrc *ir_gen_merge_err_sets(IrBuilderSrc *irb, Scope *scope, AstNode |
| 5527 | } | 5527 | } |
| 5528 | | 5528 | |
| 5529 | static IrInstSrc *ir_gen_assign(IrBuilderSrc *irb, Scope *scope, AstNode *node) { | 5529 | static IrInstSrc *ir_gen_assign(IrBuilderSrc *irb, Scope *scope, AstNode *node) { |
| 5530 | IrInstSrc *lvalue = ir_gen_node_extra(irb, node->data.bin_op_expr.op1, scope, LValPtr, nullptr); | 5530 | IrInstSrc *lvalue = ir_gen_node_extra(irb, node->data.bin_op_expr.op1, scope, LValAssign, nullptr); |
| 5531 | if (lvalue == irb->codegen->invalid_inst_src) | 5531 | if (lvalue == irb->codegen->invalid_inst_src) |
| 5532 | return irb->codegen->invalid_inst_src; | 5532 | return irb->codegen->invalid_inst_src; |
| 5533 | | 5533 | |
| ... | @@ -5546,7 +5546,7 @@ static IrInstSrc *ir_gen_assign(IrBuilderSrc *irb, Scope *scope, AstNode *node) | ... | @@ -5546,7 +5546,7 @@ static IrInstSrc *ir_gen_assign(IrBuilderSrc *irb, Scope *scope, AstNode *node) |
| 5546 | } | 5546 | } |
| 5547 | | 5547 | |
| 5548 | static IrInstSrc *ir_gen_assign_merge_err_sets(IrBuilderSrc *irb, Scope *scope, AstNode *node) { | 5548 | static IrInstSrc *ir_gen_assign_merge_err_sets(IrBuilderSrc *irb, Scope *scope, AstNode *node) { |
| 5549 | IrInstSrc *lvalue = ir_gen_node_extra(irb, node->data.bin_op_expr.op1, scope, LValPtr, nullptr); | 5549 | IrInstSrc *lvalue = ir_gen_node_extra(irb, node->data.bin_op_expr.op1, scope, LValAssign, nullptr); |
| 5550 | if (lvalue == irb->codegen->invalid_inst_src) | 5550 | if (lvalue == irb->codegen->invalid_inst_src) |
| 5551 | return lvalue; | 5551 | return lvalue; |
| 5552 | IrInstSrc *op1 = ir_build_load_ptr(irb, scope, node->data.bin_op_expr.op1, lvalue); | 5552 | IrInstSrc *op1 = ir_build_load_ptr(irb, scope, node->data.bin_op_expr.op1, lvalue); |
| ... | @@ -5559,7 +5559,7 @@ static IrInstSrc *ir_gen_assign_merge_err_sets(IrBuilderSrc *irb, Scope *scope, | ... | @@ -5559,7 +5559,7 @@ static IrInstSrc *ir_gen_assign_merge_err_sets(IrBuilderSrc *irb, Scope *scope, |
| 5559 | } | 5559 | } |
| 5560 | | 5560 | |
| 5561 | static IrInstSrc *ir_gen_assign_op(IrBuilderSrc *irb, Scope *scope, AstNode *node, IrBinOp op_id) { | 5561 | static IrInstSrc *ir_gen_assign_op(IrBuilderSrc *irb, Scope *scope, AstNode *node, IrBinOp op_id) { |
| 5562 | IrInstSrc *lvalue = ir_gen_node_extra(irb, node->data.bin_op_expr.op1, scope, LValPtr, nullptr); | 5562 | IrInstSrc *lvalue = ir_gen_node_extra(irb, node->data.bin_op_expr.op1, scope, LValAssign, nullptr); |
| 5563 | if (lvalue == irb->codegen->invalid_inst_src) | 5563 | if (lvalue == irb->codegen->invalid_inst_src) |
| 5564 | return lvalue; | 5564 | return lvalue; |
| 5565 | IrInstSrc *op1 = ir_build_load_ptr(irb, scope, node->data.bin_op_expr.op1, lvalue); | 5565 | IrInstSrc *op1 = ir_build_load_ptr(irb, scope, node->data.bin_op_expr.op1, lvalue); |
| ... | @@ -5908,7 +5908,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, | ... | @@ -5908,7 +5908,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5908 | Buf *variable_name = node->data.symbol_expr.symbol; | 5908 | Buf *variable_name = node->data.symbol_expr.symbol; |
| 5909 | | 5909 | |
| 5910 | if (buf_eql_str(variable_name, "_")) { | 5910 | if (buf_eql_str(variable_name, "_")) { |
| 5911 | if (lval == LValPtr) { | 5911 | if (lval == LValAssign) { |
| 5912 | IrInstSrcConst *const_instruction = ir_build_instruction<IrInstSrcConst>(irb, scope, node); | 5912 | IrInstSrcConst *const_instruction = ir_build_instruction<IrInstSrcConst>(irb, scope, node); |
| 5913 | const_instruction->value = irb->codegen->pass1_arena->create<ZigValue>(); | 5913 | const_instruction->value = irb->codegen->pass1_arena->create<ZigValue>(); |
| 5914 | const_instruction->value->type = get_pointer_to_type(irb->codegen, | 5914 | const_instruction->value->type = get_pointer_to_type(irb->codegen, |
| ... | @@ -5933,7 +5933,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, | ... | @@ -5933,7 +5933,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5933 | assert(err == ErrorPrimitiveTypeNotFound); | 5933 | assert(err == ErrorPrimitiveTypeNotFound); |
| 5934 | } else { | 5934 | } else { |
| 5935 | IrInstSrc *value = ir_build_const_type(irb, scope, node, primitive_type); | 5935 | IrInstSrc *value = ir_build_const_type(irb, scope, node, primitive_type); |
| 5936 | if (lval == LValPtr) { | 5936 | if (lval == LValPtr || lval == LValAssign) { |
| 5937 | return ir_build_ref_src(irb, scope, node, value); | 5937 | return ir_build_ref_src(irb, scope, node, value); |
| 5938 | } else { | 5938 | } else { |
| 5939 | return ir_expr_wrap(irb, scope, value, result_loc); | 5939 | return ir_expr_wrap(irb, scope, value, result_loc); |
| ... | @@ -5944,7 +5944,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, | ... | @@ -5944,7 +5944,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5944 | ZigVar *var = find_variable(irb->codegen, scope, variable_name, &crossed_fndef_scope); | 5944 | ZigVar *var = find_variable(irb->codegen, scope, variable_name, &crossed_fndef_scope); |
| 5945 | if (var) { | 5945 | if (var) { |
| 5946 | IrInstSrc *var_ptr = ir_build_var_ptr_x(irb, scope, node, var, crossed_fndef_scope); | 5946 | IrInstSrc *var_ptr = ir_build_var_ptr_x(irb, scope, node, var, crossed_fndef_scope); |
| 5947 | if (lval == LValPtr) { | 5947 | if (lval == LValPtr || lval == LValAssign) { |
| 5948 | return var_ptr; | 5948 | return var_ptr; |
| 5949 | } else { | 5949 | } else { |
| 5950 | return ir_expr_wrap(irb, scope, ir_build_load_ptr(irb, scope, node, var_ptr), result_loc); | 5950 | return ir_expr_wrap(irb, scope, ir_build_load_ptr(irb, scope, node, var_ptr), result_loc); |
| ... | @@ -5954,7 +5954,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, | ... | @@ -5954,7 +5954,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5954 | Tld *tld = find_decl(irb->codegen, scope, variable_name); | 5954 | Tld *tld = find_decl(irb->codegen, scope, variable_name); |
| 5955 | if (tld) { | 5955 | if (tld) { |
| 5956 | IrInstSrc *decl_ref = ir_build_decl_ref(irb, scope, node, tld, lval); | 5956 | IrInstSrc *decl_ref = ir_build_decl_ref(irb, scope, node, tld, lval); |
| 5957 | if (lval == LValPtr) { | 5957 | if (lval == LValPtr || lval == LValAssign) { |
| 5958 | return decl_ref; | 5958 | return decl_ref; |
| 5959 | } else { | 5959 | } else { |
| 5960 | return ir_expr_wrap(irb, scope, decl_ref, result_loc); | 5960 | return ir_expr_wrap(irb, scope, decl_ref, result_loc); |
| ... | @@ -5995,7 +5995,7 @@ static IrInstSrc *ir_gen_array_access(IrBuilderSrc *irb, Scope *scope, AstNode * | ... | @@ -5995,7 +5995,7 @@ static IrInstSrc *ir_gen_array_access(IrBuilderSrc *irb, Scope *scope, AstNode * |
| 5995 | | 5995 | |
| 5996 | IrInstSrc *ptr_instruction = ir_build_elem_ptr(irb, scope, node, array_ref_instruction, | 5996 | IrInstSrc *ptr_instruction = ir_build_elem_ptr(irb, scope, node, array_ref_instruction, |
| 5997 | subscript_instruction, true, PtrLenSingle, nullptr); | 5997 | subscript_instruction, true, PtrLenSingle, nullptr); |
| 5998 | if (lval == LValPtr) | 5998 | if (lval == LValPtr || lval == LValAssign) |
| 5999 | return ptr_instruction; | 5999 | return ptr_instruction; |
| 6000 | | 6000 | |
| 6001 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, ptr_instruction); | 6001 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, ptr_instruction); |
| ... | @@ -6754,7 +6754,7 @@ static IrInstSrc *ir_gen_builtin_fn_call(IrBuilderSrc *irb, Scope *scope, AstNod | ... | @@ -6754,7 +6754,7 @@ static IrInstSrc *ir_gen_builtin_fn_call(IrBuilderSrc *irb, Scope *scope, AstNod |
| 6754 | IrInstSrc *ptr_instruction = ir_build_field_ptr_instruction(irb, scope, node, | 6754 | IrInstSrc *ptr_instruction = ir_build_field_ptr_instruction(irb, scope, node, |
| 6755 | arg0_value, arg1_value, false); | 6755 | arg0_value, arg1_value, false); |
| 6756 | | 6756 | |
| 6757 | if (lval == LValPtr) | 6757 | if (lval == LValPtr || lval == LValAssign) |
| 6758 | return ptr_instruction; | 6758 | return ptr_instruction; |
| 6759 | | 6759 | |
| 6760 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, ptr_instruction); | 6760 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, ptr_instruction); |
| ... | @@ -7479,6 +7479,7 @@ static IrInstSrc *ir_lval_wrap(IrBuilderSrc *irb, Scope *scope, IrInstSrc *value | ... | @@ -7479,6 +7479,7 @@ static IrInstSrc *ir_lval_wrap(IrBuilderSrc *irb, Scope *scope, IrInstSrc *value |
| 7479 | return value; | 7479 | return value; |
| 7480 | } | 7480 | } |
| 7481 | | 7481 | |
| | 7482 | assert(lval != LValAssign); |
| 7482 | if (lval == LValPtr) { | 7483 | if (lval == LValPtr) { |
| 7483 | // We needed a pointer to a value, but we got a value. So we create | 7484 | // We needed a pointer to a value, but we got a value. So we create |
| 7484 | // an instruction which just makes a pointer of it. | 7485 | // an instruction which just makes a pointer of it. |
| ... | @@ -9962,7 +9963,7 @@ static IrInstSrc *ir_gen_node_raw(IrBuilderSrc *irb, AstNode *node, Scope *scope | ... | @@ -9962,7 +9963,7 @@ static IrInstSrc *ir_gen_node_raw(IrBuilderSrc *irb, AstNode *node, Scope *scope |
| 9962 | IrInstSrc *ptr_instruction = ir_gen_field_access(irb, scope, node); | 9963 | IrInstSrc *ptr_instruction = ir_gen_field_access(irb, scope, node); |
| 9963 | if (ptr_instruction == irb->codegen->invalid_inst_src) | 9964 | if (ptr_instruction == irb->codegen->invalid_inst_src) |
| 9964 | return ptr_instruction; | 9965 | return ptr_instruction; |
| 9965 | if (lval == LValPtr) | 9966 | if (lval == LValPtr || lval == LValAssign) |
| 9966 | return ptr_instruction; | 9967 | return ptr_instruction; |
| 9967 | | 9968 | |
| 9968 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, ptr_instruction); | 9969 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, ptr_instruction); |
| ... | @@ -9970,7 +9971,12 @@ static IrInstSrc *ir_gen_node_raw(IrBuilderSrc *irb, AstNode *node, Scope *scope | ... | @@ -9970,7 +9971,12 @@ static IrInstSrc *ir_gen_node_raw(IrBuilderSrc *irb, AstNode *node, Scope *scope |
| 9970 | } | 9971 | } |
| 9971 | case NodeTypePtrDeref: { | 9972 | case NodeTypePtrDeref: { |
| 9972 | AstNode *expr_node = node->data.ptr_deref_expr.target; | 9973 | AstNode *expr_node = node->data.ptr_deref_expr.target; |
| 9973 | IrInstSrc *value = ir_gen_node_extra(irb, expr_node, scope, lval, nullptr); | 9974 | |
| | 9975 | LVal child_lval = lval; |
| | 9976 | if (child_lval == LValAssign) |
| | 9977 | child_lval = LValPtr; |
| | 9978 | |
| | 9979 | IrInstSrc *value = ir_gen_node_extra(irb, expr_node, scope, child_lval, nullptr); |
| 9974 | if (value == irb->codegen->invalid_inst_src) | 9980 | if (value == irb->codegen->invalid_inst_src) |
| 9975 | return value; | 9981 | return value; |
| 9976 | | 9982 | |
| ... | @@ -9988,7 +9994,7 @@ static IrInstSrc *ir_gen_node_raw(IrBuilderSrc *irb, AstNode *node, Scope *scope | ... | @@ -9988,7 +9994,7 @@ static IrInstSrc *ir_gen_node_raw(IrBuilderSrc *irb, AstNode *node, Scope *scope |
| 9988 | return irb->codegen->invalid_inst_src; | 9994 | return irb->codegen->invalid_inst_src; |
| 9989 | | 9995 | |
| 9990 | IrInstSrc *unwrapped_ptr = ir_build_optional_unwrap_ptr(irb, scope, node, maybe_ptr, true, false); | 9996 | IrInstSrc *unwrapped_ptr = ir_build_optional_unwrap_ptr(irb, scope, node, maybe_ptr, true, false); |
| 9991 | if (lval == LValPtr) | 9997 | if (lval == LValPtr || lval == LValAssign) |
| 9992 | return unwrapped_ptr; | 9998 | return unwrapped_ptr; |
| 9993 | | 9999 | |
| 9994 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, unwrapped_ptr); | 10000 | IrInstSrc *load_ptr = ir_build_load_ptr(irb, scope, node, unwrapped_ptr); |
| ... | @@ -10068,6 +10074,97 @@ static ResultLoc *no_result_loc(void) { | ... | @@ -10068,6 +10074,97 @@ static ResultLoc *no_result_loc(void) { |
| 10068 | static IrInstSrc *ir_gen_node_extra(IrBuilderSrc *irb, AstNode *node, Scope *scope, LVal lval, | 10074 | static IrInstSrc *ir_gen_node_extra(IrBuilderSrc *irb, AstNode *node, Scope *scope, LVal lval, |
| 10069 | ResultLoc *result_loc) | 10075 | ResultLoc *result_loc) |
| 10070 | { | 10076 | { |
| | 10077 | if (lval == LValAssign) { |
| | 10078 | switch (node->type) { |
| | 10079 | case NodeTypeStructValueField: |
| | 10080 | case NodeTypeParamDecl: |
| | 10081 | case NodeTypeUsingNamespace: |
| | 10082 | case NodeTypeSwitchProng: |
| | 10083 | case NodeTypeSwitchRange: |
| | 10084 | case NodeTypeStructField: |
| | 10085 | case NodeTypeErrorSetField: |
| | 10086 | case NodeTypeFnDef: |
| | 10087 | case NodeTypeTestDecl: |
| | 10088 | zig_unreachable(); |
| | 10089 | |
| | 10090 | // cannot be assigned to |
| | 10091 | case NodeTypeBlock: |
| | 10092 | case NodeTypeGroupedExpr: |
| | 10093 | case NodeTypeBinOpExpr: |
| | 10094 | case NodeTypeIntLiteral: |
| | 10095 | case NodeTypeFloatLiteral: |
| | 10096 | case NodeTypeCharLiteral: |
| | 10097 | case NodeTypeIfBoolExpr: |
| | 10098 | case NodeTypeContainerInitExpr: |
| | 10099 | case NodeTypeVariableDeclaration: |
| | 10100 | case NodeTypeWhileExpr: |
| | 10101 | case NodeTypeForExpr: |
| | 10102 | case NodeTypeReturnExpr: |
| | 10103 | case NodeTypeBoolLiteral: |
| | 10104 | case NodeTypeArrayType: |
| | 10105 | case NodeTypePointerType: |
| | 10106 | case NodeTypeAnyFrameType: |
| | 10107 | case NodeTypeStringLiteral: |
| | 10108 | case NodeTypeUndefinedLiteral: |
| | 10109 | case NodeTypeAsmExpr: |
| | 10110 | case NodeTypeNullLiteral: |
| | 10111 | case NodeTypeIfErrorExpr: |
| | 10112 | case NodeTypeIfOptional: |
| | 10113 | case NodeTypeSwitchExpr: |
| | 10114 | case NodeTypeCompTime: |
| | 10115 | case NodeTypeNoAsync: |
| | 10116 | case NodeTypeErrorType: |
| | 10117 | case NodeTypeBreak: |
| | 10118 | case NodeTypeContinue: |
| | 10119 | case NodeTypeUnreachable: |
| | 10120 | case NodeTypeDefer: |
| | 10121 | case NodeTypeSliceExpr: |
| | 10122 | case NodeTypeCatchExpr: |
| | 10123 | case NodeTypeContainerDecl: |
| | 10124 | case NodeTypeFnProto: |
| | 10125 | case NodeTypeErrorSetDecl: |
| | 10126 | case NodeTypeResume: |
| | 10127 | case NodeTypeAwaitExpr: |
| | 10128 | case NodeTypeSuspend: |
| | 10129 | case NodeTypeEnumLiteral: |
| | 10130 | case NodeTypeInferredArrayType: |
| | 10131 | case NodeTypeVarFieldType: |
| | 10132 | case NodeTypePrefixOpExpr: |
| | 10133 | add_node_error(irb->codegen, node, |
| | 10134 | buf_sprintf("invalid left-hand side to assignment")); |
| | 10135 | return irb->codegen->invalid_inst_src; |
| | 10136 | |
| | 10137 | // @field can be assigned to |
| | 10138 | case NodeTypeFnCallExpr: |
| | 10139 | if (node->data.fn_call_expr.modifier == CallModifierBuiltin) { |
| | 10140 | AstNode *fn_ref_expr = node->data.fn_call_expr.fn_ref_expr; |
| | 10141 | Buf *name = fn_ref_expr->data.symbol_expr.symbol; |
| | 10142 | auto entry = irb->codegen->builtin_fn_table.maybe_get(name); |
| | 10143 | |
| | 10144 | if (!entry) { |
| | 10145 | add_node_error(irb->codegen, node, |
| | 10146 | buf_sprintf("invalid builtin function: '%s'", buf_ptr(name))); |
| | 10147 | return irb->codegen->invalid_inst_src; |
| | 10148 | } |
| | 10149 | |
| | 10150 | if (entry->value->id == BuiltinFnIdField) { |
| | 10151 | break; |
| | 10152 | } |
| | 10153 | } |
| | 10154 | add_node_error(irb->codegen, node, |
| | 10155 | buf_sprintf("invalid left-hand side to assignment")); |
| | 10156 | return irb->codegen->invalid_inst_src; |
| | 10157 | |
| | 10158 | |
| | 10159 | // can be assigned to |
| | 10160 | case NodeTypeUnwrapOptional: |
| | 10161 | case NodeTypePtrDeref: |
| | 10162 | case NodeTypeFieldAccessExpr: |
| | 10163 | case NodeTypeArrayAccessExpr: |
| | 10164 | case NodeTypeSymbol: |
| | 10165 | break; |
| | 10166 | } |
| | 10167 | } |
| 10071 | if (result_loc == nullptr) { | 10168 | if (result_loc == nullptr) { |
| 10072 | // Create a result location indicating there is none - but if one gets created | 10169 | // Create a result location indicating there is none - but if one gets created |
| 10073 | // it will be properly distributed. | 10170 | // it will be properly distributed. |
| ... | @@ -20581,7 +20678,7 @@ static IrInstGen *ir_analyze_instruction_un_op(IrAnalyze *ira, IrInstSrcUnOp *in | ... | @@ -20581,7 +20678,7 @@ static IrInstGen *ir_analyze_instruction_un_op(IrAnalyze *ira, IrInstSrcUnOp *in |
| 20581 | return ira->codegen->invalid_inst_gen; | 20678 | return ira->codegen->invalid_inst_gen; |
| 20582 | | 20679 | |
| 20583 | // If the result needs to be an lvalue, type check it | 20680 | // If the result needs to be an lvalue, type check it |
| 20584 | if (instruction->lval == LValPtr && result->value->type->id != ZigTypeIdPointer) { | 20681 | if (instruction->lval != LValNone && result->value->type->id != ZigTypeIdPointer) { |
| 20585 | ir_add_error(ira, &instruction->base.base, | 20682 | ir_add_error(ira, &instruction->base.base, |
| 20586 | buf_sprintf("attempt to dereference non-pointer type '%s'", buf_ptr(&result->value->type->name))); | 20683 | buf_sprintf("attempt to dereference non-pointer type '%s'", buf_ptr(&result->value->type->name))); |
| 20587 | return ira->codegen->invalid_inst_gen; | 20684 | return ira->codegen->invalid_inst_gen; |
| ... | @@ -21175,7 +21272,7 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP | ... | @@ -21175,7 +21272,7 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP |
| 21175 | nullptr, nullptr); | 21272 | nullptr, nullptr); |
| 21176 | } else if (return_type->data.pointer.explicit_alignment != 0) { | 21273 | } else if (return_type->data.pointer.explicit_alignment != 0) { |
| 21177 | uint32_t chosen_align; | 21274 | uint32_t chosen_align; |
| 21178 | if ((err = compute_elem_align(ira, return_type->data.pointer.child_type, | 21275 | if ((err = compute_elem_align(ira, return_type->data.pointer.child_type, |
| 21179 | return_type->data.pointer.explicit_alignment, index, &chosen_align))) | 21276 | return_type->data.pointer.explicit_alignment, index, &chosen_align))) |
| 21180 | { | 21277 | { |
| 21181 | return ira->codegen->invalid_inst_gen; | 21278 | return ira->codegen->invalid_inst_gen; |
| ... | @@ -23348,7 +23445,7 @@ static IrInstGen *ir_analyze_instruction_ref(IrAnalyze *ira, IrInstSrcRef *ref_i | ... | @@ -23348,7 +23445,7 @@ static IrInstGen *ir_analyze_instruction_ref(IrAnalyze *ira, IrInstSrcRef *ref_i |
| 23348 | IrInstGen *value = ref_instruction->value->child; | 23445 | IrInstGen *value = ref_instruction->value->child; |
| 23349 | if (type_is_invalid(value->value->type)) | 23446 | if (type_is_invalid(value->value->type)) |
| 23350 | return ira->codegen->invalid_inst_gen; | 23447 | return ira->codegen->invalid_inst_gen; |
| 23351 | | 23448 | |
| 23352 | bool is_const = false; | 23449 | bool is_const = false; |
| 23353 | bool is_volatile = false; | 23450 | bool is_volatile = false; |
| 23354 | | 23451 | |
| ... | @@ -28878,7 +28975,7 @@ static IrInstGen *ir_analyze_instruction_decl_ref(IrAnalyze *ira, IrInstSrcDeclR | ... | @@ -28878,7 +28975,7 @@ static IrInstGen *ir_analyze_instruction_decl_ref(IrAnalyze *ira, IrInstSrcDeclR |
| 28878 | return ira->codegen->invalid_inst_gen; | 28975 | return ira->codegen->invalid_inst_gen; |
| 28879 | } | 28976 | } |
| 28880 | | 28977 | |
| 28881 | if (instruction->lval == LValPtr) { | 28978 | if (instruction->lval == LValPtr || instruction->lval == LValAssign) { |
| 28882 | return ref_instruction; | 28979 | return ref_instruction; |
| 28883 | } else { | 28980 | } else { |
| 28884 | return ir_get_deref(ira, &instruction->base.base, ref_instruction, nullptr); | 28981 | return ir_get_deref(ira, &instruction->base.base, ref_instruction, nullptr); |