Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | Fix build when JIT is disabled on 32bit systems |
| 2 | |
| 3 | This fixes a compile time assert |
| 4 | js/src/wasm/WasmFrame.cpp:57:3: error: static_assert failed due to requirement '(__builtin_offsetof(js::wasm::DebugFrame, frame_) + sizeof(js::wasm::Frame)) % Alignment == 0' "Aligned after pushing DebugFrame" |
| 5 | static_assert((offsetof(DebugFrame, frame_) + sizeof(Frame)) % Alignment == 0, |
| 6 | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | |
| 11 | --- a/js/src/wasm/WasmFrame.h |
| 12 | +++ b/js/src/wasm/WasmFrame.h |
| 13 | @@ -230,6 +230,8 @@ class DebugFrame { |
| 14 | // Avoid -Wunused-private-field warnings. |
| 15 | protected: |
| 16 | #if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_ARM) || \ |
| 17 | + (defined(JS_CODEGEN_NONE) && \ |
| 18 | + (defined(__riscv) && __riscv_xlen == 32) || defined(__mips__)) || \ |
| 19 | defined(JS_CODEGEN_X86) || defined(__wasi__) |
| 20 | // See alignmentStaticAsserts(). For MIPS32, ARM32 and X86 DebugFrame is only |
| 21 | // 4-byte aligned, so we add another word to get up to 8-byte |