aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/go.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y
index 01a4e822fb..d3e363d370 100644
--- a/src/cmd/gc/go.y
+++ b/src/cmd/gc/go.y
@@ -1462,6 +1462,9 @@ non_dcl_stmt:
}
| if_stmt LELSE stmt
{
+ if($3->op != OIF && $3->op != OBLOCK)
+ yyerror("missing { } after else");
+
popdcl();
$$ = $1;
$$->nelse = list1($3);