From: Ian Lance Taylor Date: Wed, 22 Dec 2010 16:27:51 +0000 (+0000) Subject: Don't crash on erroneous channel send or receive. X-Git-Tag: releases/gcc-4.6.0~1661 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a4eaec2b9463b0783f9505416f13056a69dcac0;p=thirdparty%2Fgcc.git Don't crash on erroneous channel send or receive. From-SVN: r168174 --- diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc index 5a6f0792fcc8..a5fb5f675892 100644 --- a/gcc/go/gofrontend/gogo-tree.cc +++ b/gcc/go/gofrontend/gogo-tree.cc @@ -2895,6 +2895,9 @@ tree Gogo::send_on_channel(tree channel, tree val, bool blocking, bool for_select, source_location location) { + if (channel == error_mark_node || val == error_mark_node) + return error_mark_node; + if (int_size_in_bytes(TREE_TYPE(val)) <= 8 && !AGGREGATE_TYPE_P(TREE_TYPE(val)) && !FLOAT_TYPE_P(TREE_TYPE(val))) @@ -3029,6 +3032,9 @@ tree Gogo::receive_from_channel(tree type_tree, tree channel, bool for_select, source_location location) { + if (type_tree == error_mark_node || channel == error_mark_node) + return error_mark_node; + if (int_size_in_bytes(type_tree) <= 8 && !AGGREGATE_TYPE_P(type_tree) && !FLOAT_TYPE_P(type_tree))