Branch: Tag:

2020-01-03

2020-01-03 10:00:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Support T_ARRAY and T_STRING nodes with non-NULL car.

Preparation for using the car for holding the length type.

231:    * MAPPING index type value type    * OR type (not OR) type    * AND type type -  * ARRAY - type +  * ARRAY len type type len added in 8.1    * MULTISET type -    * NOT type -    * '0'-'9' - -    * FLOAT - - -  * STRING - ZERO, INT or OR Range added in 7.7 +  * STRING len type ZERO, INT or OR len:8.1, Range:7.7    * TYPE type -    * PROGRAM type -    * MIXED - -
318:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    /* Free car & cdr */    free_type(car);    t = (struct pike_type *) cdr;
339:       case T_SCOPE:    case T_ASSIGN: -  case T_ARRAY: -  case T_STRING: +     /* Free cdr */    t = (struct pike_type *) cdr;    debug_free_type_preamble (t);
491:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    /* Free car & cdr */    free_type((struct pike_type *)debug_malloc_pass(car));    free_type((struct pike_type *)debug_malloc_pass(cdr));
510:       case T_SCOPE:    case T_ASSIGN: -  case T_ARRAY: -  case T_STRING: +     /* Free cdr */    free_type((struct pike_type *)debug_malloc_pass(cdr));    break;
596:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    debug_malloc_pass(car);    debug_malloc_pass(cdr);    break;
612:    t->flags |= PT_FLAG_ASSIGN_0 << PTR_TO_INT(car);    /* FALLTHRU */    case T_SCOPE: -  case T_ARRAY: -  case T_STRING: +     debug_malloc_pass(cdr);    break;   
9173:    case T_ASSIGN:    case PIKE_T_NAME:    case PIKE_T_ATTRIBUTE: -  case PIKE_T_ARRAY: +     if (t->cdr) gc_mark_type_as_referenced(t->cdr);    break;    case PIKE_T_FUNCTION:
9183:    case PIKE_T_MAPPING:    case T_OR:    case T_AND: +  case PIKE_T_ARRAY: +  case PIKE_T_STRING:    if (t->cdr) gc_mark_type_as_referenced(t->cdr);    /* FALLTHROUGH */    case PIKE_T_MULTISET:
9268:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    debug_gc_check (t->car, " as car in a type");    debug_gc_check (t->cdr, " as cdr in a type");    break;
9289:    break;    case T_SCOPE:    case T_ASSIGN: -  case T_ARRAY: -  case T_STRING: +     debug_gc_check (t->cdr, " as cdr in a type");    break;   #ifdef PIKE_DEBUG