mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 683802 - Add jsval to the XPTCMiniVariant union for type safety. r=mrbkap
This commit is contained in:
parent
8a2ae11493
commit
c6981dfa25
@ -2848,12 +2848,9 @@ CallMethodHelper::ConvertIndependentParam(uint8 i)
|
||||
// indirectly, regardless of in/out-ness.
|
||||
if(type_tag == nsXPTType::T_JSVAL)
|
||||
{
|
||||
// Assign the value
|
||||
JS_STATIC_ASSERT(sizeof(jsval) <= sizeof(dp->val));
|
||||
jsval *rootp = (jsval *)&dp->val;
|
||||
dp->ptr = rootp;
|
||||
*rootp = JSVAL_VOID;
|
||||
if(!JS_AddValueRoot(mCallContext, rootp))
|
||||
// Root the value.
|
||||
dp->val.j = JSVAL_VOID;
|
||||
if (!JS_AddValueRoot(mCallContext, &dp->val.j))
|
||||
return JS_FALSE;
|
||||
dp->SetValIsJSRoot();
|
||||
}
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "nsISupports.h"
|
||||
#include "xpt_struct.h"
|
||||
#include "xptinfo.h"
|
||||
#include "jsapi.h"
|
||||
|
||||
struct nsXPTCMiniVariant
|
||||
{
|
||||
@ -73,6 +74,11 @@ struct nsXPTCMiniVariant
|
||||
char c;
|
||||
PRUnichar wc;
|
||||
void* p;
|
||||
|
||||
// Types below here are unknown to the assembly implementations, and
|
||||
// therefore _must_ be passed with indirect semantics. We put them in
|
||||
// the union here for type safety, so that we can avoid void* tricks.
|
||||
jsval j;
|
||||
} val;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user