From edba18f766b01bc1dbbd4599676e487989bcf58d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Bargull?= Date: Wed, 17 Apr 2024 05:52:03 +0000 Subject: [PATCH] Bug 1891688: Don't rely on static_assert(false) being valid in uninstantiated templates. r=jandem Clang-17 (or later) and GCC-13 (or later) support even with `-std=c++17`, but we still support older compilers, so we can't use `static_assert` here. Also replaced `if constexpr` with a simple `if`, because the `constexpr` part is no longer used. Differential Revision: https://phabricator.services.mozilla.com/D207527 --- js/src/jit/CodeGenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index bdcfe4080dbc..9a4003455276 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -6879,9 +6879,9 @@ void CodeGenerator::emitAlignStackForApplyNative(T* apply, Register argc) { "aligning on JIT stack subsumes ABI alignment"); // Align the arguments on the JitStackAlignment. - if constexpr (JitStackValueAlignment > 1) { - static_assert(JitStackValueAlignment == 2, - "Stack padding adds exactly one Value"); + if (JitStackValueAlignment > 1) { + MOZ_ASSERT(JitStackValueAlignment == 2, + "Stack padding adds exactly one Value"); MOZ_ASSERT(frameSize() % JitStackValueAlignment == 0, "Stack padding assumes that the frameSize is correct"); -- 2.11.4.GIT