Skip to content

Commit 3836048

Browse files
committed
Fixed a bug where is_present was not correctly mapped to the Python action capsule.
1 parent 79c4c0e commit 3836048

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xtext/org.icyphy.linguafranca/src/lib/Python/pythontarget.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static PyTypeObject port_instance_token_t = {
661661
static PyMemberDef action_capsule_members[] = {
662662
{"action", T_OBJECT, offsetof(generic_action_capsule_struct, action), 0, "The pointer to the C action struct"},
663663
{"value", T_OBJECT, offsetof(generic_action_capsule_struct, value), 0, "Value of the action"},
664-
{"is_present", T_BOOL, offsetof(generic_action_capsule_struct, value), 0, "Check that shows if action is present"},
664+
{"is_present", T_BOOL, offsetof(generic_action_capsule_struct, is_present), 0, "Check that shows if action is present"},
665665
{NULL} /* Sentinel */
666666
};
667667

@@ -856,7 +856,7 @@ PyObject* convert_C_port_to_py(void* port, int width) {
856856
if (cport->value == NULL) {
857857
// Value is absent
858858
Py_INCREF(Py_None);
859-
((generic_action_capsule_struct*)cap)->value = Py_None;
859+
((generic_port_capsule_struct*)cap)->value = Py_None;
860860
return cap;
861861
}
862862

@@ -866,7 +866,7 @@ PyObject* convert_C_port_to_py(void* port, int width) {
866866
else {
867867
// Value is absent
868868
Py_INCREF(Py_None);
869-
((generic_action_capsule_struct*)cap)->value = Py_None;
869+
((generic_port_capsule_struct*)cap)->value = Py_None;
870870
((generic_port_capsule_struct*)cap)->is_present = false;
871871
}
872872

0 commit comments

Comments
 (0)