authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-03-26 23:39:29+01:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-03-26 23:39:29+01:00
loga217ad59c770eb3915f5b98f177a012181b7f48e
tree7021ce2645df50b14ddeb5054d8daa71870d6450
parent22338d781679f3210fe599a4a4972d4835589adb
signaturelock-open Commit is signed but in an unrecognized format.

astgen: fix result location for sliced objects


1 files changed, 3 insertions(+), 3 deletions(-)

src/astgen.zig+3-3
......@@ -436,7 +436,7 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) In
436436 .@"for" => return forExpr(mod, scope, rl, node, tree.forFull(node)),
437437
438438 .slice_open => {
439 const lhs = try expr(mod, scope, .{ .ty = .usize_type }, node_datas[node].lhs);
439 const lhs = try expr(mod, scope, .ref, node_datas[node].lhs);
440440 const start = try expr(mod, scope, .{ .ty = .usize_type }, node_datas[node].rhs);
441441 const result = try gz.addPlNode(.slice_start, node, zir.Inst.SliceStart{
442442 .lhs = lhs,
......@@ -445,7 +445,7 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) In
445445 return rvalue(mod, scope, rl, result, node);
446446 },
447447 .slice => {
448 const lhs = try expr(mod, scope, .{ .ty = .usize_type }, node_datas[node].lhs);
448 const lhs = try expr(mod, scope, .ref, node_datas[node].lhs);
449449 const extra = tree.extraData(node_datas[node].rhs, ast.Node.Slice);
450450 const start = try expr(mod, scope, .{ .ty = .usize_type }, extra.start);
451451 const end = try expr(mod, scope, .{ .ty = .usize_type }, extra.end);
......@@ -457,7 +457,7 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) In
457457 return rvalue(mod, scope, rl, result, node);
458458 },
459459 .slice_sentinel => {
460 const lhs = try expr(mod, scope, .{ .ty = .usize_type }, node_datas[node].lhs);
460 const lhs = try expr(mod, scope, .ref, node_datas[node].lhs);
461461 const extra = tree.extraData(node_datas[node].rhs, ast.Node.SliceSentinel);
462462 const start = try expr(mod, scope, .{ .ty = .usize_type }, extra.start);
463463 const end = try expr(mod, scope, .{ .ty = .usize_type }, extra.end);