From e197253558b89419180779a063c8ae1db7b026e6 Mon Sep 17 00:00:00 2001 From: Blub Date: Wed, 2 Sep 2009 13:22:32 +0000 Subject: [PATCH] -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 --- engine/qclib/qcc_pr_comp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index e6eca7490..34b7764e2 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -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))