VirtualBox

Changeset 70577 in vbox for trunk/src/libs


Ignore:
Timestamp:
Jan 13, 2018 6:43:03 PM (7 years ago)
Author:
vboxsync
Message:

xpcom/VBoxPython: Fixed broken string handling in py3. Fixed wrong module+init names with the pymalloc abi variant.

Location:
trunk/src/libs/xpcom18a4/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/Makefile.kmk

    r69111 r70577  
    125125        $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
    126126
     127# pymalloc abi variant.
     128VBoxPythonBase_m_EXTENDS    = VBoxPythonBase
     129VBoxPythonBase_m_DEFS       = MODULE_NAME_SUFFIX=m $(VBoxPythonBase_DEFS)
     130
    127131# 32-bit base.
    128132VBoxPythonBase_x86_TEMPLATE = XPCOM-x86
     
    133137        $(PATH_STAGE_BIN)/VBoxXPCOM-x86$(VBOX_SUFF_DLL)
    134138
     139# 32-bit pymalloc abi variant.
     140VBoxPythonBase_x86_m_EXTENDS    = VBoxPythonBase_x86
     141VBoxPythonBase_x86_m_DEFS       = MODULE_NAME_SUFFIX=_x86m $(VBoxPythonBase_DEFS)
     142
    135143
    136144ifdef VBOX_PYTHON26_INC
     
    231239#
    232240DLLS += VBoxPython3_2m
    233 VBoxPython3_2m_EXTENDS    = VBoxPythonBase
     241VBoxPython3_2m_EXTENDS    = VBoxPythonBase_m
    234242VBoxPython3_2m_EXTENDS_BY = appending
    235243VBoxPython3_2m_TEMPLATE   = XPCOM
    236244VBoxPython3_2m_INCS       = $(VBOX_PYTHON32M_INC)
    237245VBoxPython3_2m_LIBS       = $(VBOX_PYTHON32M_LIB)
     246VBoxPython3_2m_DEFS       = MODULE_NAME_SUFFIX
    238247
    239248 ifdef VBOX_WITH_32_ON_64_MAIN_API
    240249  ifdef VBOX_PYTHON32M_LIB_X86
    241250DLLS += VBoxPython3_2m_x86
    242 VBoxPython3_2m_x86_EXTENDS    = VBoxPythonBase_x86
     251VBoxPython3_2m_x86_EXTENDS    = VBoxPythonBase_x86_m
    243252VBoxPython3_2m_x86_EXTENDS_BY = appending
    244253VBoxPython3_2m_x86_TEMPLATE   = XPCOM
     
    277286#
    278287DLLS += VBoxPython3_3m
    279 VBoxPython3_3m_EXTENDS    = VBoxPythonBase
     288VBoxPython3_3m_EXTENDS    = VBoxPythonBase_m
    280289VBoxPython3_3m_EXTENDS_BY = appending
    281290VBoxPython3_3m_TEMPLATE   = XPCOM
     
    286295  ifdef VBOX_PYTHON33M_LIB_X86
    287296DLLS += VBoxPython3_3m_x86
    288 VBoxPython3_3m_x86_EXTENDS    = VBoxPythonBase_x86
     297VBoxPython3_3m_x86_EXTENDS    = VBoxPythonBase_x86_m
    289298VBoxPython3_3m_x86_EXTENDS_BY = appending
    290299VBoxPython3_3m_x86_TEMPLATE   = XPCOM
     
    323332#
    324333DLLS += VBoxPython3_4m
    325 VBoxPython3_4m_EXTENDS    = VBoxPythonBase
     334VBoxPython3_4m_EXTENDS    = VBoxPythonBase_m
    326335VBoxPython3_4m_EXTENDS_BY = appending
    327336VBoxPython3_4m_TEMPLATE   = XPCOM
     
    332341  ifdef VBOX_PYTHON34M_LIB_X86
    333342DLLS += VBoxPython3_4m_x86
    334 VBoxPython3_4m_x86_EXTENDS    = VBoxPythonBase_x86
     343VBoxPython3_4m_x86_EXTENDS    = VBoxPythonBase_x86_m
    335344VBoxPython3_4m_x86_EXTENDS_BY = appending
    336345VBoxPython3_4m_x86_TEMPLATE   = XPCOM
     
    369378#
    370379DLLS += VBoxPython3_5m
    371 VBoxPython3_5m_EXTENDS    = VBoxPythonBase
     380VBoxPython3_5m_EXTENDS    = VBoxPythonBase_m
    372381VBoxPython3_5m_EXTENDS_BY = appending
    373382VBoxPython3_5m_TEMPLATE   = XPCOM
     
    378387  ifdef VBOX_PYTHON35M_LIB_X86
    379388DLLS += VBoxPython3_5m_x86
    380 VBoxPython3_5m_x86_EXTENDS    = VBoxPythonBase_x86
     389VBoxPython3_5m_x86_EXTENDS    = VBoxPythonBase_x86_m
    381390VBoxPython3_5m_x86_EXTENDS_BY = appending
    382391VBoxPython3_5m_x86_TEMPLATE   = XPCOM
     
    415424#
    416425DLLS += VBoxPython3_6m
    417 VBoxPython3_6m_EXTENDS    = VBoxPythonBase
     426VBoxPython3_6m_EXTENDS    = VBoxPythonBase_m
    418427VBoxPython3_6m_EXTENDS_BY = appending
    419428VBoxPython3_6m_TEMPLATE   = XPCOM
     
    424433  ifdef VBOX_PYTHON36M_LIB_X86
    425434DLLS += VBoxPython3_6m_x86
    426 VBoxPython3_6m_x86_EXTENDS    = VBoxPythonBase_x86
     435VBoxPython3_6m_x86_EXTENDS    = VBoxPythonBase_x86_m
    427436VBoxPython3_6m_x86_EXTENDS_BY = appending
    428437VBoxPython3_6m_x86_TEMPLATE   = XPCOM
     
    461470#
    462471DLLS += VBoxPython3_7m
    463 VBoxPython3_7m_EXTENDS    = VBoxPythonBase
     472VBoxPython3_7m_EXTENDS    = VBoxPythonBase_m
    464473VBoxPython3_7m_EXTENDS_BY = appending
    465474VBoxPython3_7m_TEMPLATE   = XPCOM
     
    470479  ifdef VBOX_PYTHON37M_LIB_X86
    471480DLLS += VBoxPython3_7m_x86
    472 VBoxPython3_7m_x86_EXTENDS    = VBoxPythonBase_x86
     481VBoxPython3_7m_x86_EXTENDS    = VBoxPythonBase_x86_m
    473482VBoxPython3_7m_x86_EXTENDS_BY = appending
    474 VBoxPython3_7m_x86_TEMPLATE   = XPCOM
     483VBoxPython3_7m_x86_TEMPLATE_   = XPCOM
    475484VBoxPython3_7m_x86_INCS       = $(VBOX_PYTHON37M_INC)
    476485VBoxPython3_7m_x86_LIBS       = $(VBOX_PYTHON37M_LIB_X86)
  • trunk/src/libs/xpcom18a4/python/src/VariantUtils.cpp

    r62332 r70577  
    9797        src = PyString_AS_STRING(s) + 2;
    9898#else
    99     if (!PyBytes_Check(obj))
     99    if (!PyBytes_Check(s))
    100100    {
    101101        PyErr_SetString(PyExc_TypeError, "internal error in PyXPCOM, parameter must be a bytes object");
    102102        return -1;
    103103    }
    104     size = (PyBytes_GET_SIZE(obj) - 2) / sizeof(PRUnichar);
    105     src = PyBytes_AS_STRING(obj) + 2;
     104    size = (PyBytes_GET_SIZE(s) - 2) / sizeof(PRUnichar);
     105    src = PyBytes_AS_STRING(s) + 2;
    106106#endif
    107107        dest = (PRUnichar *)nsMemory::Alloc(sizeof(PRUnichar) * (size + 1));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette