OSDN Git Service

Don't lower blocks twice.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Aug 2011 22:02:01 +0000 (22:02 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Aug 2011 22:02:01 +0000 (22:02 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178263 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index 4aafe41..c544eba 100644 (file)
@@ -1268,6 +1268,12 @@ Lower_parse_tree::function(Named_object* no)
 int
 Lower_parse_tree::statement(Block* block, size_t* pindex, Statement* sorig)
 {
+  // Because we explicitly traverse the statement's contents
+  // ourselves, we want to skip block statements here.  There is
+  // nothing to lower in a block statement.
+  if (sorig->is_block_statement())
+    return TRAVERSE_CONTINUE;
+
   Statement_inserter hold_inserter(this->inserter_);
   this->inserter_ = Statement_inserter(block, pindex);