diff --git a/C/heapgc.c b/C/heapgc.c index b8b8818ea..7ebfb9402 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -2138,8 +2138,8 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose) vars_ptr -= 2; if (heap_arity) { while (heap_arity--) { - if (*vars_ptr == 0) - break; /* term extension mark: float/longint */ + if (*vars_ptr == 0) /* float/longint extension mark */ + break; mark_external_reference(vars_ptr); vars_ptr--; } @@ -3050,8 +3050,8 @@ sweep_choicepoints(choiceptr gc_B) if (heap_arity) { while (heap_arity--) { CELL cp_cell = *vars_ptr; - if (*vars_ptr == 0) - break; /* term extension mark: float/longint */ + if (*vars_ptr == 0) /* float/longint extension mark */ + break; if (MARKED_PTR(vars_ptr)) { UNMARK(vars_ptr); if (HEAP_PTR(cp_cell)) { diff --git a/OPTYap/tab.tries.insts.i b/OPTYap/tab.tries.insts.i index d2f5d33c4..a4a27a88f 100644 --- a/OPTYap/tab.tries.insts.i +++ b/OPTYap/tab.tries.insts.i @@ -521,10 +521,11 @@ ** trie_extension ** ** ------------------------ */ -#define stack_trie_extension_instr() \ - *aux_ptr-- = TrNode_entry(node); \ - *aux_ptr = heap_arity + 1; \ - YENV = aux_ptr; \ +#define stack_trie_extension_instr() \ + *aux_ptr-- = 0; /* float/longint extension mark */ \ + *aux_ptr-- = TrNode_entry(node); \ + *aux_ptr = heap_arity + 2; \ + YENV = aux_ptr; \ next_trie_instruction(node) @@ -1233,13 +1234,15 @@ Term t; #if SIZEOF_DOUBLE == 2 * SIZEOF_INT_P + heap_arity -= 4; *t_dbl = *++aux_ptr; + ++aux_ptr; /* jump the float/longint extension mark */ *(t_dbl + 1) = *++aux_ptr; - heap_arity -= 2; #else /* SIZEOF_DOUBLE == SIZEOF_INT_P */ + heap_arity -= 2; *t_dbl = *++aux_ptr; - heap_arity -= 1; #endif /* SIZEOF_DOUBLE x SIZEOF_INT_P */ + ++aux_ptr; /* jump the float/longint extension mark */ t = MkFloatTerm(dbl); stack_trie_float_longint_instr(); ENDPBOp(); @@ -1266,9 +1269,11 @@ int heap_arity = *aux_ptr; int vars_arity = *(aux_ptr + heap_arity + 1); int subs_arity = *(aux_ptr + heap_arity + 2); - Term t = MkLongIntTerm(*++aux_ptr); + Term t; - heap_arity -= 1; + heap_arity -= 2; + t = MkLongIntTerm(*++aux_ptr); + ++aux_ptr; /* jump the float/longint extension mark */ stack_trie_float_longint_instr(); ENDPBOp();