diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-07-12 14:22:57 +0300 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-21 12:21:30 -0700 |
| commit | 29815fe9de50be3b07e39cd02ccfcc801a54c455 (patch) | |
| tree | 2f5fd0f724fa00b4629aa9509e533bc63dcc3d8f /src | |
| parent | 62120e3d0e382274dec2962f376ceb1e645f1a30 (diff) | |
| download | zig-29815fe9de50be3b07e39cd02ccfcc801a54c455.tar.gz zig-29815fe9de50be3b07e39cd02ccfcc801a54c455.zip | |
Sema: disallow 'align' on functions on wasm
Diffstat (limited to 'src')
| -rw-r--r-- | src/Sema.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 2ac27cf6b3..b821a32fc7 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -17713,6 +17713,10 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A break :blk lib_name; } else null; + if ((extra.data.bits.has_align_body or extra.data.bits.has_align_ref) and sema.mod.getTarget().cpu.arch.isWasm()) { + return sema.fail(block, align_src, "'align' is not allowed on functions in wasm", .{}); + } + const @"align": ?u32 = if (extra.data.bits.has_align_body) blk: { const body_len = sema.code.extra[extra_index]; extra_index += 1; |
