mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 00:20:37 +00:00
Bug 658351 - Add extra assertions to jsval.h to check for malformed JSBools r=bz
This commit is contained in:
parent
01fae250a5
commit
d46827fed2
@ -267,7 +267,15 @@ XPCConvert::NativeData2JS(XPCLazyCallContext& lccx, jsval* d, const void* s,
|
||||
case nsXPTType::T_U64 : *d = DOUBLE_TO_JSVAL(UINT64_TO_DOUBLE(*((uint64*)s))); break;
|
||||
case nsXPTType::T_FLOAT : *d = DOUBLE_TO_JSVAL(*((float*)s)); break;
|
||||
case nsXPTType::T_DOUBLE: *d = DOUBLE_TO_JSVAL(*((double*)s)); break;
|
||||
case nsXPTType::T_BOOL : *d = BOOLEAN_TO_JSVAL(*((PRBool*)s)); break;
|
||||
case nsXPTType::T_BOOL :
|
||||
{
|
||||
PRBool b = *((PRBool*)s);
|
||||
|
||||
NS_WARN_IF_FALSE(b == 1 || b == 0,
|
||||
"Passing a malformed PRBool through XPConnect");
|
||||
*d = BOOLEAN_TO_JSVAL(!!b);
|
||||
break;
|
||||
}
|
||||
case nsXPTType::T_CHAR :
|
||||
{
|
||||
char* p = (char*)s;
|
||||
|
Loading…
x
Reference in New Issue
Block a user