Branch: Tag:

2016-01-10

2016-01-10 23:41:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Fix regression for return with value.

Return with value in functions declared as returning void
now causes a compiler error again.

3723:    else if(Pike_compiler->compiler_frame &&    Pike_compiler->compiler_frame->current_return_type)    { -  if ((Pike_compiler->compiler_frame->current_return_type != -  void_type_string)) { +     struct pike_type *t = Pike_compiler->compiler_frame->current_return_type;       if( t->type == PIKE_T_AUTO )
3737:    else    {    /* first one.. */ -  push_auto_typed_type( CAR(n)->type ); +  push_auto_typed_type( CAR(n)->type );    }    free_type( t );    t = pop_type();    Pike_compiler->compiler_frame->current_return_type = t; -  } -  else if(CAR(n)->token != F_CONSTANT || !SAFE_IS_ZERO(&CAR(n)->u.sval)) +  } else if ((Pike_compiler->compiler_frame->current_return_type != +  void_type_string) || +  (CAR(n)->token != F_CONSTANT) || +  !SAFE_IS_ZERO(&CAR(n)->u.sval)) {    check_node_type(CAR(n), t, "Wrong return type.");    }    }