pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:6112:    int type = type_from_visit_fn(visit_dst);    struct mc_marker *ref_to = find_mc_marker(dst);    if (ref_to) {    /* Already visited or queued for visiting. */    return;    }       ref_to = my_make_mc_marker(dst, visit_dst, extra);       if (type != PIKE_T_UNKNOWN) { +  /* NB: low_mapping_insert() for object indices may throw errors +  * if eg lfun::`==() throws an error. We therefore instead +  * use the raw pointers as indices instead. +  */    struct svalue s; -  SET_SVAL(s, type, 0, refs, dst); -  low_mapping_insert(identify_loop_reverse, &s, Pike_sp-1, 0); -  +  SET_SVAL(s, PIKE_T_INT, NUMBER_NUMBER, integer, (INT_TYPE)(ptrdiff_t)dst);    mc_wq_enqueue(ref_to); -  +  low_mapping_insert(identify_loop_reverse, &s, Pike_sp-1, 0);    } else {    /* Not a valid svalue type.    *    * Probably T_MAPPING_DATA or T_MULTISET_DATA or similar.    *    * Recurse directly while we have the containing thing on the stack.    */    ref_to->flags |= MC_FLAG_INT_VISITED;    visit_dst(dst, VISIT_COMPLEX_ONLY, extra);    }
pike.git/src/gc.c:6251:    visit_enter = NULL;    visit_ref = NULL;    visit_leave = NULL;      #ifdef PIKE_DEBUG    if (s != Pike_sp-1) {    Pike_fatal("Stack error in identify_loops.\n");    }   #endif    +  /* NB: low_mapping_lookup() for object indices may throw errors +  * if eg lfun::`==() throws an error. We therefore instead +  * use the raw pointers as indices instead. +  */ +  push_int((INT_TYPE)(ptrdiff_t)s->u.refs);    while ((k = low_mapping_lookup(identify_loop_reverse, Pike_sp-1))) {    /* NB: Since we entered this loop, we know that there's a    * reference loop involving s, as s otherwise wouldn't    * have been in the mapping.    */ -  +  pop_stack();    push_svalue(k); -  +  push_int((INT_TYPE)(ptrdiff_t)k->u.refs);    if (k->u.refs == s->u.refs) {    /* Found! */ -  +  pop_stack();    break;    }    }       free_mapping(identify_loop_reverse);       stop_mc();       if (!k) {    push_undefined();