pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:9380:       case T_AND:    /* FIXME: Shouldn't both branches be looked at? */    return low_index_type(t->cdr, index_type, n);       case T_STRING: /* always int */    {    if (!t->cdr || (t->cdr->type == T_ZERO)) {    yywarning("Indexing the empty string.");    } +  if (t->cdr) {    add_ref(t->cdr); -  +  }    return t->cdr;    }       case T_MULTISET: /* always int(0..1) */    type_stack_mark();    push_int_type(0, 1);    return pop_unfinished_type();       case T_MAPPING:    type_stack_mark();
pike.git/src/pike_types.cmod:9415:    free_type(a);    push_unlimited_array_type(T_ARRAY);       if (match_types(int_type_string, index_type)) {    /* Also possible to index the array with an int. */    push_finished_type(t->cdr);    push_type(T_OR);    }    return pop_unfinished_type();    } -  if (match_types(int_type_string, index_type)) { +  if (t->cdr && match_types(int_type_string, index_type)) {    /* Possible to index the array with an int. */    add_ref(t->cdr);    return t->cdr;    }    /* Bad index type. */    return 0;    }    }   }