Skip to content

Commit e299860

Browse files
committed
FIX: invalid handle's spec offset
1 parent 0f71dd6 commit e299860

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/c-handle.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252

5353
if (!sym) return 0;
5454

55+
//printf("Register_Handle: %s with size %u\n", SYMBOL_TO_NAME(sym), size);
56+
5557
idx = Find_Handle_Index(sym);
5658
if (idx) Crash(RP_HANDLE_ALREADY_REGISTERED);
5759
idx = VAL_TAIL(handles) + 1;
@@ -60,8 +62,8 @@
6062
REBVAL *val = Append_Value(VAL_SERIES(handles));
6163
Set_Word(val, sym, 0, 0);
6264

63-
PG_Handles[idx].size = size;
64-
PG_Handles[idx].free = free_func;
65+
PG_Handles[idx-1].size = size;
66+
PG_Handles[idx-1].free = free_func;
6567

6668
return idx;
6769
}
@@ -85,6 +87,7 @@
8587
spec = PG_Handles[idx-1];
8688
size = spec.size;
8789

90+
//printf("Requested HOB for %s of size %u\n", SYMBOL_TO_NAME(sym), size);
8891
hob = (REBHOB*)Make_Node(HOB_POOL);
8992
hob->data = MAKE_MEM(size);
9093
hob->index = idx;

0 commit comments

Comments
 (0)