Bug 1499471: Mark unsafe API functions to allow calling from recovery code r=tcampbell

Differential Revision: https://phabricator.services.mozilla.com/D8899

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Iain Ireland 2018-10-16 20:55:41 +00:00
parent 5392b776a6
commit 95556db740
3 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ EmulatesUndefined(JSObject* obj)
{
// This may be called off the main thread. It's OK not to expose the object
// here as it doesn't escape.
AutoUnsafeCallWithABI unsafe;
AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
JSObject* actual = MOZ_LIKELY(!obj->is<WrapperObject>()) ? obj : UncheckedUnwrapWithoutExpose(obj);
return actual->getClass()->emulatesUndefined();
}

View File

@ -19,7 +19,7 @@ namespace js {
inline double
NumberDiv(double a, double b)
{
AutoUnsafeCallWithABI unsafe;
AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
if (b == 0) {
if (a == 0 || mozilla::IsNaN(a)) {
return JS::GenericNaN();
@ -36,7 +36,7 @@ NumberDiv(double a, double b)
inline double
NumberMod(double a, double b)
{
AutoUnsafeCallWithABI unsafe;
AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
if (b == 0) {
return JS::GenericNaN();
}

View File

@ -543,7 +543,7 @@ js::minmax_impl(JSContext* cx, bool max, HandleValue a, HandleValue b, MutableHa
double
js::powi(double x, int32_t y)
{
AutoUnsafeCallWithABI unsafe;
AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
uint32_t n = Abs(y);
double m = x;
double p = 1;