Go patch committed: Don't crash when copying call with no arguments

Submitted by Ian Taylor on Dec. 16, 2010, 1:47 a.m.

Details

Message ID mcraak6zdy0.fsf@google.com
State New
Headers show

Commit Message

Ian Taylor Dec. 16, 2010, 1:47 a.m.
I committed this patch to the Go frontend to not crash when copying a
call with no arguments.  Bootstrapped and tested on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Patch hide | download patch | download mbox

diff -r 941f436a91ac go/expressions.h
--- a/go/expressions.h	Wed Dec 15 17:25:04 2010 -0800
+++ b/go/expressions.h	Wed Dec 15 17:35:19 2010 -0800
@@ -1235,7 +1235,10 @@ 
   Expression*
   do_copy()
   {
-    return Expression::make_call(this->fn_->copy(), this->args_->copy(),
+    return Expression::make_call(this->fn_->copy(),
+				 (this->args_ == NULL
+				  ? NULL
+				  : this->args_->copy()),
 				 this->is_varargs_, this->location());
   }