Skip to content

Commit

Permalink
cbe: fix bugs revealed by an upcoming commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Mar 31, 2024
1 parent aff71c6 commit 6f10b11
Show file tree
Hide file tree
Showing 5 changed files with 1,497 additions and 1,386 deletions.
9 changes: 6 additions & 3 deletions lib/zig.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ typedef char bool;
#endif

#if zig_has_attribute(section)
#define zig_linksection(name, def, ...) def __attribute__((section(name)))
#define zig_linksection(name) __attribute__((section(name)))
#define zig_linksection_fn zig_linksection
#elif _MSC_VER
#define zig_linksection(name, def, ...) __pragma(section(name, __VA_ARGS__)) __declspec(allocate(name)) def
#define zig_linksection(name) __pragma(section(name, read, write)) __declspec(allocate(name))
#define zig_linksection_fn(name) __pragma(section(name, read, execute)) __declspec(code_seg(name))
#else
#define zig_linksection(name, def, ...) zig_linksection_unavailable
#define zig_linksection(name) zig_linksection_unavailable
#define zig_linksection_fn zig_linksection
#endif

#if zig_has_builtin(unreachable) || defined(zig_gnuc)
Expand Down
3 changes: 2 additions & 1 deletion src/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3451,7 +3451,8 @@ fn processOneJob(comp: *Compilation, job: Job, prog_node: *std.Progress.Node) !v

var dg: c_codegen.DeclGen = .{
.gpa = gpa,
.module = module,
.zcu = module,
.mod = module.namespacePtr(decl.src_namespace).file_scope.mod,
.error_msg = null,
.pass = .{ .decl = decl_index },
.is_naked_fn = false,
Expand Down
Loading

0 comments on commit 6f10b11

Please sign in to comment.