-Ocj must take OP_GOTO into account
this removes the unreachable-code warning when using 'break' at the end of an if block within a loop git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3366 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
e31fa29044
commit
e197253558
1 changed files with 2 additions and 1 deletions
|
@ -5877,7 +5877,8 @@ void QCC_PR_ParseStatement (void)
|
|||
if (QCC_PR_CheckKeyword (keyword_else, "else"))
|
||||
{
|
||||
int lastwasreturn;
|
||||
lastwasreturn = statements[numstatements-1].op == OP_RETURN || statements[numstatements-1].op == OP_DONE;
|
||||
lastwasreturn = statements[numstatements-1].op == OP_RETURN || statements[numstatements-1].op == OP_DONE ||
|
||||
statements[numstatements-1].op == OP_GOTO;
|
||||
|
||||
//the last statement of the if was a return, so we don't need the goto at the end
|
||||
if (lastwasreturn && opt_compound_jumps && !QCC_AStatementJumpsTo(numstatements, patch1-statements, numstatements))
|
||||
|
|
Loading…
Reference in a new issue