File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -515,20 +515,20 @@ def visit_PointerCast(self, o):
515515
516516 def visit_Dereference (self , o ):
517517 a0 , a1 = o .functions
518- # TODO: Temporary fix or fine? — ensures that all objects dereferenced from
519- # a PETSc struct (e.g., `ctx0`) are handled correctly.
518+ # TODO: Potentially reconsider — the `if a1.is_CompositeObject`
519+ # ensures that all objects dereferenced from a PETSc struct
520+ # (e.g., `ctx0`) are handled correctly.
520521 # **Example**
521522 # Need this: struct dataobj *rhs_vec = ctx0->rhs_vec;
522523 # Not this: PetscScalar (* rhs)[rhs_vec->size[1]] =
523524 # (PetscScalar (*)[rhs_vec->size[1]]) ctx0;
524- # This is the case when a1 is a LocalCompositeObject (i.e a1.is_AbstractObject)
525525
526526 if o .offset :
527527 ptr = f'({ a1 .name } + { o .offset } )'
528528 else :
529529 ptr = a1 .name
530530
531- if a1 .is_AbstractObject :
531+ if a1 .is_CompositeObject :
532532 rvalue = f'{ a1 .name } ->{ a0 ._C_name } '
533533 lvalue = self ._gen_value (a0 , 0 )
534534 elif a0 .is_AbstractFunction :
Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ class Basic(CodeSymbol):
296296 is_ObjectArray = False
297297 is_Bundle = False
298298 is_Object = False
299+ is_CompositeObject = False
299300 is_LocalObject = False
300301 is_LocalType = False
301302
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ class CompositeObject(Object):
132132 """
133133 Object with composite type (e.g., a C struct) defined in Python.
134134 """
135+ is_CompositeObject = True
135136
136137 __rargs__ = ('name' , 'pname' , 'pfields' )
137138
You can’t perform that action at this time.
0 commit comments