| ... | ... | @@ -1438,17 +1438,20 @@ fn assignOp( |
| 1438 | 1438 | infix_node: ast.Node.Index, |
| 1439 | 1439 | op_inst_tag: zir.Inst.Tag, |
| 1440 | 1440 | ) InnerError!void { |
| 1441 | | if (true) @panic("TODO update for zir-memory-layout"); |
| 1442 | 1441 | const tree = scope.tree(); |
| 1443 | 1442 | const node_datas = tree.nodes.items(.data); |
| 1444 | | const main_tokens = tree.nodes.items(.main_token); |
| 1443 | const gz = scope.getGenZir(); |
| 1445 | 1444 | |
| 1446 | 1445 | const lhs_ptr = try lvalExpr(mod, scope, node_datas[infix_node].lhs); |
| 1447 | | const lhs = try addZIRUnOp(mod, scope, lhs_ptr.src, .deref, lhs_ptr); |
| 1448 | | const lhs_type = try addZIRUnOp(mod, scope, lhs_ptr.src, .typeof, lhs); |
| 1446 | const lhs = try gz.addUnNode(.deref_node, lhs_ptr, infix_node); |
| 1447 | const lhs_type = try gz.addUnTok(.typeof, lhs, infix_node); |
| 1449 | 1448 | const rhs = try expr(mod, scope, .{ .ty = lhs_type }, node_datas[infix_node].rhs); |
| 1450 | | const result = try addZIRBinOp(mod, scope, src, op_inst_tag, lhs, rhs); |
| 1451 | | _ = try addZIRBinOp(mod, scope, src, .store, lhs_ptr, result); |
| 1449 | |
| 1450 | const result = try gz.addPlNode(op_inst_tag, infix_node, zir.Inst.Bin{ |
| 1451 | .lhs = lhs, |
| 1452 | .rhs = rhs, |
| 1453 | }); |
| 1454 | _ = try gz.addBin(.store, lhs_ptr, result); |
| 1452 | 1455 | } |
| 1453 | 1456 | |
| 1454 | 1457 | fn boolNot(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerError!zir.Inst.Ref { |