mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 777292 - Make sure that the Components.lastResult is interpreted as unsigned integers; r=bzbarsky
This commit is contained in:
parent
1a8367de54
commit
e53b0b3938
@ -1403,7 +1403,7 @@ nsXPCComponents_Results::NewResolve(nsIXPConnectWrappedNative *wrapper,
|
||||
nsresult rv;
|
||||
while (nsXPCException::IterateNSResults(&rv, &rv_name, nullptr, &iter)) {
|
||||
if (!strcmp(name.ptr(), rv_name)) {
|
||||
// The double cast below is required since nsresult is an enum,
|
||||
// The two casts below is required since nsresult is an enum,
|
||||
// and it can be interpreted as a signed integer if we directly
|
||||
// cast to a double.
|
||||
jsval val = JS_NumberValue((double)(uint32_t)rv);
|
||||
@ -4721,7 +4721,10 @@ nsXPCComponents::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (doResult) {
|
||||
*vp = JS_NumberValue((double) res);
|
||||
// The two casts below is required since nsresult is an enum,
|
||||
// and it can be interpreted as a signed integer if we directly
|
||||
// cast to a double.
|
||||
*vp = JS_NumberValue((double)(uint32_t) res);
|
||||
rv = NS_SUCCESS_I_DID_SOMETHING;
|
||||
}
|
||||
|
||||
@ -4873,4 +4876,4 @@ nsXPCComponents::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *glob
|
||||
}
|
||||
*parentObj = mScope->GetGlobalJSObject();
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user