Skip to content

Commit a18c983

Browse files
committed
deal with CStruct Foo as attr of CStruct Foo
1 parent e942214 commit a18c983

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/CStruct.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,14 @@ else if (repr instanceof CPointer) {
219219
}
220220
else if (repr instanceof CStruct) {
221221
info.argType = ArgType.CSTRUCT;
222-
return Type.getDescriptor(((CStructREPRData) info.type.st.REPRData).structureClass);
222+
Class c = ((CStructREPRData) info.type.st.REPRData).structureClass;
223+
224+
/* When we hit a struct in an attribute that is not composed yet, we most likely
225+
* have hit a struct of our own kind. */
226+
if (c == null)
227+
return "L__CStruct__" + typeId + ";";
228+
229+
return Type.getDescriptor(c);
223230
}
224231
else {
225232
ExceptionHandling.dieInternal(tc, "CStruct representation only handles int, num, CArray, CPointer and CStruct");

0 commit comments

Comments
 (0)