Skip to content

Commit

Permalink
only negate MYDIMS_TRANS if removed trans is trans_parent
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 21, 2024
1 parent 9b3b381 commit b62b689
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Basic/Core/pdlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ pdl_error pdl__free(pdl *it) {
return PDL_err;
}

/* NULL out the pdl from the trans's inputs, and the trans from the
pdl's trans_children */
void pdl__removetrans_children(pdl *it,pdl_trans *trans)
{
PDLDEBUG_f(printf("pdl__removetrans_children(%s=%p): %p\n",
Expand All @@ -298,12 +300,15 @@ void pdl__removetrans_children(pdl *it,pdl_trans *trans)
pdl_pdl_warn("Child not found for pdl %p, trans %p\n",it, trans);
}

/* NULL out the trans's nth pdl in/output, and this trans as pdl's
trans_parent */
void pdl__removetrans_parent(pdl *it, pdl_trans *trans, PDL_Indx nth)
{
PDLDEBUG_f(printf("pdl__removetrans_parent from %p (%s=%p): %"IND_FLAG"\n",
it, trans->vtable->name, trans, nth));
trans->pdls[nth] = 0;
if (it->trans_parent == trans) it->trans_parent = 0;
if (it->trans_parent != trans) return; /* only do rest if trans is parent */
it->trans_parent = 0;
it->state &= ~PDL_MYDIMS_TRANS;
}

Expand Down

0 comments on commit b62b689

Please sign in to comment.