mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #2083 - Part 2: Remove use of RegExpGuard.
Based on Mozilla bug 1345177. There were more uses of RegExpGuard in js/src/builtin/RegExp.cpp not found in the original bug's patch.
This commit is contained in:
parent
3796c7c1e1
commit
d163d08cb2
21 changed files with 92 additions and 73 deletions
|
|
@ -327,7 +327,7 @@ BaseProxyHandler::fun_toString(JSContext* cx, HandleObject proxy, bool isToSourc
|
|||
|
||||
bool
|
||||
BaseProxyHandler::regexp_toShared(JSContext* cx, HandleObject proxy,
|
||||
RegExpGuard* g) const
|
||||
MutableHandleRegExpShared shared) const
|
||||
{
|
||||
MOZ_CRASH("This should have been a wrapped regexp");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -437,9 +437,10 @@ CrossCompartmentWrapper::fun_toString(JSContext* cx, HandleObject wrapper, bool
|
|||
}
|
||||
|
||||
bool
|
||||
CrossCompartmentWrapper::regexp_toShared(JSContext* cx, HandleObject wrapper, RegExpGuard* g) const
|
||||
CrossCompartmentWrapper::regexp_toShared(JSContext* cx, HandleObject wrapper,
|
||||
MutableHandleRegExpShared shared) const
|
||||
{
|
||||
RegExpGuard re(cx);
|
||||
RootedRegExpShared re(cx);
|
||||
{
|
||||
AutoCompartment call(cx, wrappedObject(wrapper));
|
||||
if (!Wrapper::regexp_toShared(cx, wrapper, &re))
|
||||
|
|
@ -447,7 +448,7 @@ CrossCompartmentWrapper::regexp_toShared(JSContext* cx, HandleObject wrapper, Re
|
|||
}
|
||||
|
||||
// Get an equivalent RegExpShared associated with the current compartment.
|
||||
return cx->compartment()->regExps.get(cx, re->getSource(), re->getFlags(), g);
|
||||
return cx->compartment()->regExps.get(cx, re->getSource(), re->getFlags(), shared);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ DeadObjectProxy::fun_toString(JSContext* cx, HandleObject proxy, bool isToSource
|
|||
}
|
||||
|
||||
bool
|
||||
DeadObjectProxy::regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g) const
|
||||
DeadObjectProxy::regexp_toShared(JSContext* cx, HandleObject proxy,
|
||||
MutableHandle<RegExpShared*> shared) const
|
||||
{
|
||||
ReportDead(cx);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ class DeadObjectProxy : public BaseProxyHandler
|
|||
virtual const char* className(JSContext* cx, HandleObject proxy) const override;
|
||||
virtual JSString* fun_toString(JSContext* cx, HandleObject proxy,
|
||||
bool isToSource) const override;
|
||||
virtual bool regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g) const override;
|
||||
virtual bool regexp_toShared(JSContext* cx, HandleObject proxy,
|
||||
MutableHandle<RegExpShared*> shared) const override;
|
||||
|
||||
virtual bool isCallable(JSObject* obj) const override;
|
||||
virtual bool isConstructor(JSObject* obj) const override;
|
||||
|
|
|
|||
|
|
@ -488,10 +488,10 @@ Proxy::fun_toString(JSContext* cx, HandleObject proxy, bool isToSource)
|
|||
}
|
||||
|
||||
bool
|
||||
Proxy::regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g)
|
||||
Proxy::regexp_toShared(JSContext* cx, HandleObject proxy, MutableHandleRegExpShared shared)
|
||||
{
|
||||
JS_CHECK_RECURSION(cx, return false);
|
||||
return proxy->as<ProxyObject>().handler()->regexp_toShared(cx, proxy, g);
|
||||
return proxy->as<ProxyObject>().handler()->regexp_toShared(cx, proxy, shared);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ class Proxy
|
|||
static bool isArray(JSContext* cx, HandleObject proxy, JS::IsArrayAnswer* answer);
|
||||
static const char* className(JSContext* cx, HandleObject proxy);
|
||||
static JSString* fun_toString(JSContext* cx, HandleObject proxy, bool isToSource);
|
||||
static bool regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g);
|
||||
static bool regexp_toShared(JSContext* cx, HandleObject proxy,
|
||||
MutableHandle<RegExpShared*> shared);
|
||||
static bool boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp);
|
||||
|
||||
static bool getElements(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end,
|
||||
|
|
|
|||
|
|
@ -1265,7 +1265,8 @@ ScriptedProxyHandler::fun_toString(JSContext* cx, HandleObject proxy, bool isToS
|
|||
}
|
||||
|
||||
bool
|
||||
ScriptedProxyHandler::regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g) const
|
||||
ScriptedProxyHandler::regexp_toShared(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleRegExpShared shared) const
|
||||
{
|
||||
MOZ_CRASH("Should not end up in ScriptedProxyHandler::regexp_toShared");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class ScriptedProxyHandler : public BaseProxyHandler
|
|||
virtual JSString* fun_toString(JSContext* cx, HandleObject proxy,
|
||||
bool isToSource) const override;
|
||||
virtual bool regexp_toShared(JSContext* cx, HandleObject proxy,
|
||||
RegExpGuard* g) const override;
|
||||
MutableHandle<RegExpShared*> shared) const override;
|
||||
virtual bool boxedValue_unbox(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleValue vp) const override;
|
||||
|
||||
|
|
|
|||
|
|
@ -93,9 +93,10 @@ SecurityWrapper<Base>::isArray(JSContext* cx, HandleObject obj, JS::IsArrayAnswe
|
|||
|
||||
template <class Base>
|
||||
bool
|
||||
SecurityWrapper<Base>::regexp_toShared(JSContext* cx, HandleObject obj, RegExpGuard* g) const
|
||||
SecurityWrapper<Base>::regexp_toShared(JSContext* cx, HandleObject obj,
|
||||
MutableHandle<RegExpShared*> shared) const
|
||||
{
|
||||
return Base::regexp_toShared(cx, obj, g);
|
||||
return Base::regexp_toShared(cx, obj, shared);
|
||||
}
|
||||
|
||||
template <class Base>
|
||||
|
|
|
|||
|
|
@ -267,10 +267,10 @@ Wrapper::fun_toString(JSContext* cx, HandleObject proxy, bool isToSource) const
|
|||
}
|
||||
|
||||
bool
|
||||
Wrapper::regexp_toShared(JSContext* cx, HandleObject proxy, RegExpGuard* g) const
|
||||
Wrapper::regexp_toShared(JSContext* cx, HandleObject proxy, MutableHandleRegExpShared shared) const
|
||||
{
|
||||
RootedObject target(cx, proxy->as<ProxyObject>().target());
|
||||
return RegExpToShared(cx, target, g);
|
||||
return RegExpToShared(cx, target, shared);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue