From: Ian Lance Taylor Date: Tue, 21 Dec 2010 22:56:39 +0000 (+0000) Subject: Don't crash when copying a function with no closure variable. X-Git-Tag: releases/gcc-4.6.0~1692 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74d272a2e75d1724d853151427f07a3ca534a496;p=thirdparty%2Fgcc.git Don't crash when copying a function with no closure variable. From-SVN: r168140 --- diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 5d7d90bdb016..4780a8b834f9 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()); }