aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-05-26 17:16:25 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-05-26 17:17:32 +0200
commit015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c (patch)
treedc7f91bfdd2d218628a99b9c4484533b4b890246 /src/codegen.cpp
parent4b8077ea8e888382fc73dd8a19c6e9160f2cef46 (diff)
downloadzig-015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c.tar.gz
zig-015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c.zip
Make align expr on fns a compile error in Wasm
In Wasm, specifying alignment of function pointers makes little sense since function pointers are in fact indices to a Wasm table, therefore any alignment check on those is invalid. This can cause unexpected behaviour when checking expected alignment with `@ptrToInt(fn_ptr)` or similar. This commit proposes to make `align` expressions a compile error when compiled to Wasm architecture. Some references: [1] [Mozilla: WebAssembly Tables](https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format#WebAssembly_tables) [2] [Sunfishcode's Wasm Ref Manual](https://github.com/sunfishcode/wasm-reference-manual/blob/master/WebAssembly.md#indirect-call)
Diffstat (limited to 'src/codegen.cpp')
0 files changed, 0 insertions, 0 deletions