mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 899976 - GC: Fix unsafe references related to ToInt* functions - browser changes r=bholley
This commit is contained in:
parent
938093c13e
commit
83e7e190e6
@ -523,7 +523,8 @@ LockedFile::SetLocation(JSContext* aCx,
|
||||
}
|
||||
|
||||
uint64_t location;
|
||||
if (!JS::ToUint64(aCx, aLocation, &location)) {
|
||||
JS::Rooted<JS::Value> value(aCx, aLocation);
|
||||
if (!JS::ToUint64(aCx, value, &location)) {
|
||||
return NS_ERROR_TYPE_ERR;
|
||||
}
|
||||
|
||||
|
@ -497,23 +497,23 @@ def writeArgumentUnboxing(f, i, name, type, optional, rvdeclared,
|
||||
isSetter = (i is None)
|
||||
|
||||
if isSetter:
|
||||
argPtr = "argv"
|
||||
argPtr = "argv[0].address()"
|
||||
argVal = "argv[0]"
|
||||
elif optional:
|
||||
if typeName == "[jsval]":
|
||||
val = "JSVAL_VOID"
|
||||
val = "JS::UndefinedHandleValue"
|
||||
else:
|
||||
val = "JSVAL_NULL"
|
||||
val = "JS::NullHandleValue"
|
||||
argVal = "(%d < argc ? argv[%d] : %s)" % (i, i, val)
|
||||
if typeName == "[jsval]":
|
||||
# This should use the rooted argument,
|
||||
# however we probably won't ever need to support that.
|
||||
argPtr = None
|
||||
else:
|
||||
argPtr = "(%d < argc ? &argv[%d] : NULL)" % (i, i)
|
||||
argPtr = "(%d < argc ? argv[%d].address() : NULL)" % (i, i)
|
||||
else:
|
||||
argVal = "argv[%d]" % i
|
||||
argPtr = "&" + argVal
|
||||
argPtr = argVal + ".address()"
|
||||
|
||||
params = {
|
||||
'name': name,
|
||||
@ -879,7 +879,7 @@ def writeQuickStub(f, customMethodCalls, stringtable, member, stubName,
|
||||
rvdeclared = False
|
||||
if isMethod:
|
||||
if len(member.params) > 0:
|
||||
f.write(" jsval *argv = JS_ARGV(cx, vp);\n")
|
||||
f.write(" JS::CallArgs argv = JS::CallArgsFromVp(argc, vp);\n")
|
||||
for i, param in enumerate(member.params):
|
||||
argName = 'arg%d' % i
|
||||
argTypeKey = argName + 'Type'
|
||||
@ -897,7 +897,7 @@ def writeQuickStub(f, customMethodCalls, stringtable, member, stubName,
|
||||
nullBehavior=param.null,
|
||||
undefinedBehavior=param.undefined)
|
||||
elif isSetter:
|
||||
f.write(" jsval *argv = JS_ARGV(cx, vp);\n")
|
||||
f.write(" JS::CallArgs argv = JS::CallArgsFromVp(argc, vp);\n")
|
||||
rvdeclared = writeArgumentUnboxing(f, None, 'arg0', member.realtype,
|
||||
optional=False,
|
||||
rvdeclared=rvdeclared,
|
||||
|
Loading…
Reference in New Issue
Block a user