mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #1240 - Part 8 - Fix incorrect asserts with debug enabled. Fix BigInt errors in remainder operations https://bugzilla.mozilla.org/show_bug.cgi?id=1524136 Also fix 2 debug asserts in fallthroughs due to missing BigInt cases.
This commit is contained in:
parent
4a3f1b7570
commit
7a30b0fa2d
3 changed files with 7 additions and 2 deletions
|
|
@ -1508,6 +1508,8 @@ DispatchTyped(F f, const JS::Value& val, Args&&... args)
|
|||
return f(&val.toObject(), mozilla::Forward<Args>(args)...);
|
||||
if (val.isSymbol())
|
||||
return f(val.toSymbol(), mozilla::Forward<Args>(args)...);
|
||||
if (val.isBigInt())
|
||||
return f(val.toBigInt(), mozilla::Forward<Args>(args)...);
|
||||
if (MOZ_UNLIKELY(val.isPrivateGCThing()))
|
||||
return DispatchTyped(f, val.toGCCellPtr(), mozilla::Forward<Args>(args)...);
|
||||
MOZ_ASSERT(!val.isGCThing());
|
||||
|
|
|
|||
|
|
@ -8093,6 +8093,9 @@ ICTypeOf_Typed::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
masm.branchTestSymbol(Assembler::NotEqual, R0, &failure);
|
||||
break;
|
||||
|
||||
case JSTYPE_BIGINT:
|
||||
return false;
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Unexpected type");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1778,7 +1778,7 @@ BigInt* BigInt::mod(ExclusiveContext* cx, HandleBigInt x, HandleBigInt y) {
|
|||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(remainder);
|
||||
return remainder;
|
||||
return destructivelyTrimHighZeroDigits(cx, remainder);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2195,7 +2195,7 @@ uint64_t BigInt::toUint64(BigInt* x) {
|
|||
|
||||
uint64_t digit = x->digit(0);
|
||||
|
||||
if (DigitBits == 32 && x->digitLength() >= 1) {
|
||||
if (DigitBits == 32 && x->digitLength() > 1) {
|
||||
digit |= static_cast<uint64_t>(x->digit(1)) << 32;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue