Skip to content

Commit 9b2e3d3

Browse files
committed
Fix: graal_hpy_bulk_free need to deal with LLVM pointers and longs
1 parent 1fef06e commit 9b2e3d3

File tree

1 file changed

+6
-6
lines changed
  • graalpython/com.oracle.graal.python.cext/hpy

1 file changed

+6
-6
lines changed

graalpython/com.oracle.graal.python.cext/hpy/hpy.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,19 +584,19 @@ void graal_hpy_write_ptr(void* object, HPy_ssize_t offset, void* value) {
584584

585585
typedef void (*destroyfunc)(void *);
586586
/* to be used from Java code only */
587-
int graal_hpy_bulk_free(void* ptrArray[], int64_t len) {
587+
int graal_hpy_bulk_free(uint64_t ptrArray[], int64_t len) {
588588
int64_t i;
589-
void* obj;
589+
uint64_t obj;
590590
destroyfunc func;
591591

592592
for (i=0; i < len; i+=2) {
593593
obj = ptrArray[i];
594-
func = ptrArray[i+1];
595-
if (obj != NULL) {
594+
func = (destroyfunc) ptrArray[i+1];
595+
if (obj) {
596596
if (func != NULL) {
597-
func(obj);
597+
func((void *) obj);
598598
}
599-
free(obj);
599+
free((void *) obj);
600600
}
601601
}
602602
return 0;

0 commit comments

Comments
 (0)