aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/typecheck.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/typecheck/typecheck.go')
-rw-r--r--src/cmd/compile/internal/typecheck/typecheck.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go
index 240f0409e7..030158b1a1 100644
--- a/src/cmd/compile/internal/typecheck/typecheck.go
+++ b/src/cmd/compile/internal/typecheck/typecheck.go
@@ -2104,7 +2104,7 @@ func CheckUnused(fn *ir.Func) {
// CheckReturn makes sure that fn terminates appropriately.
func CheckReturn(fn *ir.Func) {
- if fn.Type().NumResults() != 0 && len(fn.Body) != 0 {
+ if fn.Type() != nil && fn.Type().NumResults() != 0 && len(fn.Body) != 0 {
markBreak(fn)
if !isTermNodes(fn.Body) {
base.ErrorfAt(fn.Endlineno, "missing return at end of function")