Branch: Tag:

2017-10-22

2017-10-22 11:00:30 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Gc: Some more minor code-cleanups.

Make pointer adjustment more explicit in remaining places.

Fixes [CID 742447] some more.

5717:    continue;       else if (!REFCOUNTED_TYPE(TYPEOF(*s))) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    SIMPLE_ARG_TYPE_ERROR (
5729:    if (TYPEOF(*s) == T_FUNCTION) {    struct svalue s2;    if (!(s2.u.program = program_from_function (s))) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    SIMPLE_ARG_TYPE_ERROR (
5753:    if (!mc_block_pike_cycle_depth && TYPEOF(*s) == T_OBJECT) {    int cycle_depth = mc_cycle_depth_from_obj (s->u.object);    if (TYPEOF(throw_value) != PIKE_T_FREE) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    throw_severity = THROW_ERROR;
5882:    }       if (TYPEOF(throw_value) != PIKE_T_FREE) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    throw_severity = THROW_ERROR;
6287:    mc_ref_from = (void *) (ptrdiff_t) -1;   #endif    -  /* NB: 1-based indexing in mc_work_queue. */ -  mc_work_queue++; +  mc_work_queue++; /* Compensate for 1-based indexing. */    free(mc_work_queue);    mc_work_queue = NULL;