summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch/vmpa.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-11-23 15:59:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-11-23 15:59:19 (GMT)
commit411f03130cf45194689bc344f19a3b77c33a31ae (patch)
treef047b62015eb37e30629398f9adcb977a5a6c6f6 /plugins/pychrysalide/arch/vmpa.c
parent80d779749adf228078b61f268bf952ba91a277f0 (diff)
Restore more features for formats.
Diffstat (limited to 'plugins/pychrysalide/arch/vmpa.c')
-rw-r--r--plugins/pychrysalide/arch/vmpa.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/pychrysalide/arch/vmpa.c b/plugins/pychrysalide/arch/vmpa.c
index 20784cd..5162fac 100644
--- a/plugins/pychrysalide/arch/vmpa.c
+++ b/plugins/pychrysalide/arch/vmpa.c
@@ -824,13 +824,23 @@ PyObject *build_from_internal_vmpa(const vmpa2t *addr)
PyTypeObject *type; /* Type à instancier */
PyObject *args; /* Liste des arguments d'appel */
- type = get_python_vmpa_type();
+ if (get_phy_addr(addr) == VMPA_NO_PHYSICAL && get_virt_addr(addr) == VMPA_NO_VIRTUAL)
+ {
+ result = Py_None;
+ Py_INCREF(result);
+ }
+
+ else
+ {
+ type = get_python_vmpa_type();
- args = Py_BuildValue("KK", get_phy_addr(addr), get_virt_addr(addr));
+ args = Py_BuildValue("KK", get_phy_addr(addr), get_virt_addr(addr));
- result = PyObject_CallObject((PyObject *)type, args);
+ result = PyObject_CallObject((PyObject *)type, args);
- Py_DECREF(args);
+ Py_DECREF(args);
+
+ }
return result;