Commit db37e160 authored by Robert Griesemer's avatar Robert Griesemer
Browse files

go/parser: make sure we have a valid AST when 'if' condition is missing

This prevents a crash in go/types due to a nil condition in an 'if'
statement. There's more we can do to make go/types more robust but
this will address the immediate cause and also makes sure that the
parser returns a valid AST in this case.

Fixes #25438.

Change-Id: Ie55dc2c722352a5ecb17af6a16983741e8a8b515
Reviewed-on: https://go-review.googlesource.com/113735


Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Reviewed-by: default avatarDominik Honnef <dominik@honnef.co>
Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
parent 8a16c710
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment