Force expected crashes on unexpected magic values

master
Fedor 2019-03-30 04:56:13 +03:00
parent 2d009f3fa3
commit e93b35424f
1 changed files with 5 additions and 2 deletions

View File

@ -567,8 +567,11 @@ class MOZ_NON_PARAM alignas(8) Value
} }
bool isMagic(JSWhyMagic why) const { bool isMagic(JSWhyMagic why) const {
MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why); if (!isMagic()) {
return isMagic(); return false;
}
MOZ_RELEASE_ASSERT(data.s.payload.why == why);
return true;
} }
JS::TraceKind traceKind() const { JS::TraceKind traceKind() const {