Commit 2e13188
committed
Fix #28008: Handle unmanaged classes in c_addrOf with wide pointers
When c_addrOf is called on an unmanaged class in a wide pointer context
(e.g., with CHPL_COMM=gasnet or --no-local), the current implementation
incorrectly tries to take the address of the variable itself using
c_pointer_return, which treats it as a wide pointer. However, unmanaged
class variables are stored as narrow pointers even in wide pointer contexts.
This causes:
- Segfaults with CHPL_COMM=gasnet
- Assertion failures with --no-local and assertions enabled
Solution:
Add specialized overloads of c_addrOf and c_addrOfConst for unmanaged
classes that use c_ptrTo/c_ptrToConst instead of c_pointer_return.
This correctly handles the narrow pointer value rather than taking
the address of the variable.
The fix adds:
- c_addrOf overload for isUnmanagedClass(t) returning c_ptr(void)
- c_addrOfConst overload for isUnmanagedClass(t) returning c_ptrConst(void)1 parent 634d394 commit 2e13188
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1029 | 1039 | | |
1030 | 1040 | | |
1031 | 1041 | | |
| |||
1044 | 1054 | | |
1045 | 1055 | | |
1046 | 1056 | | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1047 | 1063 | | |
1048 | 1064 | | |
1049 | 1065 | | |
| |||
0 commit comments