From c6e54b5208ee1eff7d0ff1c03b73b9282bccd25a Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 21 Mar 2019 21:28:10 +0100 Subject: [PATCH] Force expected crashes on unexpected magic values. --- js/public/Value.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/public/Value.h b/js/public/Value.h index 01666ed4e1..7c4f833e3d 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -567,8 +567,11 @@ class MOZ_NON_PARAM alignas(8) Value } bool isMagic(JSWhyMagic why) const { - MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why); - return isMagic(); + if (!isMagic()) { + return false; + } + MOZ_RELEASE_ASSERT(data.s.payload.why == why); + return true; } JS::TraceKind traceKind() const {