diff --git a/main/gbc/gbc_trans_ctrl.c b/main/gbc/gbc_trans_ctrl.c index 276e5c020..92b2d37d2 100644 --- a/main/gbc/gbc_trans_ctrl.c +++ b/main/gbc/gbc_trans_ctrl.c @@ -960,7 +960,8 @@ void TRANS_for(void) control_enter(RS_FOR); - TRANS_affectation(FALSE); + if (!TRANS_affectation(FALSE)) + THROW(E_SYNTAX); if (!CODE_check_pop_local_last(&local)) THROW("Loop variable must be local"); diff --git a/main/gbc/gbc_trans_expr.c b/main/gbc/gbc_trans_expr.c index c03532cdb..7f09531a6 100644 --- a/main/gbc/gbc_trans_expr.c +++ b/main/gbc/gbc_trans_expr.c @@ -698,7 +698,7 @@ bool TRANS_affectation(bool dup) look++; } - if (!equal) + if (!equal || look == JOB->current) return FALSE; left = JOB->current;