From 74d272a2e75d1724d853151427f07a3ca534a496 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 21 Dec 2010 22:56:39 +0000 Subject: [PATCH] Don't crash when copying a function with no closure variable. From-SVN: r168140 --- gcc/go/gofrontend/expressions.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 5d7d90b..4780a8b 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1346,7 +1346,9 @@ class Func_expression : public Expression do_copy() { return Expression::make_func_reference(this->function_, - this->closure_->copy(), + (this->closure_ == NULL + ? NULL + : this->closure_->copy()), this->location()); } -- 2.7.4