aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig2
-rw-r--r--src/translate_c/ast.zig2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index c1cca84f62..68a008e0e1 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1541,7 +1541,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
}
}
- if (comp.bin_file.options.use_stage1) {
+ if (comp.bin_file.options.use_stage1 and comp.bin_file.options.module != null) {
try comp.work_queue.writeItem(.{ .stage1_module = {} });
}
diff --git a/src/translate_c/ast.zig b/src/translate_c/ast.zig
index 70c8c6559f..cdf8d778b2 100644
--- a/src/translate_c/ast.zig
+++ b/src/translate_c/ast.zig
@@ -754,7 +754,7 @@ pub fn render(gpa: *Allocator, nodes: []const Node) !std.zig.ast.Tree {
});
return std.zig.ast.Tree{
- .source = ctx.buf.toOwnedSlice(),
+ .source = try ctx.buf.toOwnedSliceSentinel(0),
.tokens = ctx.tokens.toOwnedSlice(),
.nodes = ctx.nodes.toOwnedSlice(),
.extra_data = ctx.extra_data.toOwnedSlice(gpa),