Commit d532c21d89

Veikka Tuominen <git@vexu.eu>
2022-03-12 12:40:47
AstGen: fix nosuspendExpr handling result location twice
1 parent 487ee79
Changed files (2)
lib/std/dwarf.zig
@@ -822,7 +822,7 @@ pub const DwarfInfo = struct {
                     // in the list itself.
                     // If no starting value is specified use zero.
                     var base_address = compile_unit.die.getAttrAddr(AT.low_pc) catch |err| switch (err) {
-                        error.MissingDebugInfo => 0,
+                        error.MissingDebugInfo => @as(u64, 0), // TODO https://github.com/ziglang/zig/issues/11135
                         else => return err,
                     };
 
src/AstGen.zig
@@ -1035,9 +1035,8 @@ fn nosuspendExpr(
         });
     }
     gz.nosuspend_node = node;
-    const result = try expr(gz, scope, rl, body_node);
-    gz.nosuspend_node = 0;
-    return rvalue(gz, rl, result, node);
+    defer gz.nosuspend_node = 0;
+    return expr(gz, scope, rl, body_node);
 }
 
 fn suspendExpr(