NS_ASSERTION(data->mType == nsIDataType::TYPE_ARRAY, "bad FreeArray call");
NS_ASSERTION(data->mType == nsIDataType::VTYPE_ARRAY, "bad FreeArray call");
static void FreeArray(nsDiscriminatedUnion* data){    NS_ASSERTION(data->mType == nsIDataType::TYPE_ARRAY, "bad FreeArray call");    NS_ASSERTION(data->array.mArrayValue, "bad array");    NS_ASSERTION(data->array.mArrayCount, "bad array count");#define CASE__FREE_ARRAY_PTR(type_, ctype_)                                   \        case nsIDataType:: type_ :                                            \        {                                                                     \            ctype_ ** p = (ctype_ **) data->array.mArrayValue;                \            for(PRUint32 i = data->array.mArrayCount; i > 0; p++, i--)        \                if(*p)                                                        \                    nsMemory::Free((char*)*p);                                \            break;                                                            \        }#define CASE__FREE_ARRAY_IFACE(type_, ctype_)                                 \        case nsIDataType:: type_ :                                            \        {                                                                     \            ctype_ ** p = (ctype_ **) data->array.mArrayValue;                \            for(PRUint32 i = data->array.mArrayCount; i > 0; p++, i--)        \                if(*p)                                                        \                    (*p)->Release();                                          \            break;                                                            \        }        switch(data->array.mArrayType)    {        case nsIDataType::TYPE_INT8:                case nsIDataType::TYPE_INT16:                case nsIDataType::TYPE_INT32:                case nsIDataType::TYPE_INT64:                case nsIDataType::TYPE_UINT8:                case nsIDataType::TYPE_UINT16:                case nsIDataType::TYPE_UINT32:                case nsIDataType::TYPE_UINT64:                case nsIDataType::TYPE_FLOAT:                case nsIDataType::TYPE_DOUBLE:                case nsIDataType::TYPE_BOOL:                case nsIDataType::TYPE_CHAR:                case nsIDataType::TYPE_WCHAR:                    break;        // XXX We ASSUME that "array of nsID" means "array of pointers to nsID".        CASE__FREE_ARRAY_PTR(TYPE_ID, nsID)        CASE__FREE_ARRAY_PTR(TYPE_CHAR_STR, char)        CASE__FREE_ARRAY_PTR(TYPE_WCHAR_STR, PRUnichar)        CASE__FREE_ARRAY_IFACE(TYPE_INTERFACE, nsISupports)        // The rest are illegal.        case nsIDataType::TYPE_VOID:                case nsIDataType::TYPE_INTERFACE_IS:                case nsIDataType::TYPE_ASTRING:                case nsIDataType::TYPE_WSTRING_SIZE_IS:                case nsIDataType::TYPE_STRING_SIZE_IS:                case nsIDataType::TYPE_ARRAY:        case nsIDataType::TYPE_EMPTY:        default:            NS_ERROR("bad type in array!");            break;    }        // Free the array memory.    nsMemory::Free((char*)data->array.mArrayValue);#undef CASE__FREE_ARRAY_PTR#undef CASE__FREE_ARRAY_IFACE}    