This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gccgo] Fix last patch
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 May 2010 12:56:47 -0700
- Subject: [gccgo] Fix last patch
This patch fixes my last patch, so that it doesn't crash on switches
with empty values. Committed to gccgo branch. This time with
testing.
Ian
diff -r 303179b475c0 go/statements.cc
--- a/go/statements.cc Thu May 13 11:58:25 2010 -0700
+++ b/go/statements.cc Tue May 18 12:54:31 2010 -0700
@@ -3337,8 +3337,9 @@
{
source_location loc = this->location();
- if (this->val_->is_error_expression()
- || this->val_->type()->is_error_type())
+ if (this->val_ != NULL
+ && (this->val_->is_error_expression()
+ || this->val_->type()->is_error_type()))
return Statement::make_error_statement(loc);
if (this->val_ != NULL