authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-28 22:08:56-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-29 02:29:37-07:00
log64a1a280ef2b5858aa9d5ec659badf3e5236b5f9
tree788612476f9087ebb91afde967c6503f300079c0
parent4beff80b2f30ad85f2127b1281053b8b25b0cc33

stage2: fix superfluous returnvoid ZIR


1 files changed, 4 insertions(+), 2 deletions(-)

src-self-hosted/astgen.zig+4-2
......@@ -145,8 +145,10 @@ pub fn blockExpr(mod: *Module, parent_scope: *Scope, block_node: *ast.Node.Block
145145
146146 else => {
147147 const possibly_unused_result = try expr(mod, scope, .none, statement);
148 const src = scope.tree().token_locs[statement.firstToken()].start;
149 _ = try addZIRUnOp(mod, scope, src, .ensure_result_used, possibly_unused_result);
148 if (!possibly_unused_result.tag.isNoReturn()) {
149 const src = scope.tree().token_locs[statement.firstToken()].start;
150 _ = try addZIRUnOp(mod, scope, src, .ensure_result_used, possibly_unused_result);
151 }
150152 },
151153 }
152154 }