pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:3133:    } else {    if ((c->lex.pragmas & ID_STRICT_TYPES) &&    !pike_types_le(expression->type, array_type_string)) {    yytype_report(REPORT_WARNING,    NULL, 0, expression->type,    NULL, 0, array_type_string,    0,    "Argument 1 to foreach() is not always an array.");    }    -  if( lvalues->type->type == PIKE_T_AUTO ) -  { -  if(val_type) -  copy_pike_type( *val_type, expression->type->car ); -  } -  else -  { +     if (!lvalues) {    /* No loop variable. Will be converted to a counted loop    * by treeopt. */ -  +  } else if( lvalues->type->type == PIKE_T_AUTO ) { +  if(val_type) +  copy_pike_type( *val_type, expression->type->car );    } else if (pike_types_le(lvalues->type, void_type_string)) {    yyerror("Bad argument 2 to foreach().");    } else {    struct pike_type *array_value_type;       type_stack_mark();    push_finished_type(lvalues->type);    push_type(T_ARRAY);    array_value_type = pop_unfinished_type();       check_node_type(expression, array_value_type,    "Argument 1 to foreach() does not match loop variable type.");    free_type(array_value_type);    }    } -  } +     free_type(array_zero);    }    }   }      static struct pike_string *get_name_of_function(node *n)   {    struct pike_string *name = NULL;    if (!n) {    MAKE_CONST_STRING(name, "NULL");