diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-12-21 22:56:39 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-12-21 22:56:39 +0000 |
commit | 74d272a2e75d1724d853151427f07a3ca534a496 (patch) | |
tree | a3a6ebc10995f535e5807626d3fb677016406016 | |
parent | 1575c9deaec2277485cfa6f870826c9bcfe9172d (diff) | |
download | gcc-74d272a2e75d1724d853151427f07a3ca534a496.zip gcc-74d272a2e75d1724d853151427f07a3ca534a496.tar.gz gcc-74d272a2e75d1724d853151427f07a3ca534a496.tar.bz2 |
Don't crash when copying a function with no closure variable.
From-SVN: r168140
-rw-r--r-- | gcc/go/gofrontend/expressions.h | 4 |
1 files changed, 3 insertions, 1 deletions
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()); } |