Branch: Tag:

2019-09-27

2019-09-27 16:31:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Warn about broken use of yield() et al.

2523:    Pike_compiler->compiler_frame->generator_index-1);    emit1(F_ASSIGN_LOCAL_AND_POP,    Pike_compiler->compiler_frame->generator_local); +  } else if (CDR(n) && CDR(n)->u.sval.u.integer) { +  if (CDR(n)->u.sval.u.integer == 1) { +  yywarning("Continue return statement in non-generator function."); +  } else { +  yywarning("Yield expression in non-generator function.");    } -  +  yywarning("Converted into a plain return."); +  }       /* Insert the appropriate number of F_ESCAPE_CATCH. The rest of    * the cleanup is handled wholesale in low_return et al.