projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8386b63
)
Don't crash using value of something with no value.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 19 Jan 2011 05:38:41 +0000
(
05:38
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 19 Jan 2011 05:38:41 +0000
(
05:38
+0000)
From-SVN: r168982
gcc/go/gofrontend/types.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/types.cc
b/gcc/go/gofrontend/types.cc
index dd0a861d49feba51bddb1a5f32ae983f2577a3e3..840de2ba82f36c14f03338d7a0550543a393ec65 100644
(file)
--- a/
gcc/go/gofrontend/types.cc
+++ b/
gcc/go/gofrontend/types.cc
@@
-482,6
+482,15
@@
bool
Type::are_assignable(const Type* lhs, const Type* rhs, std::string* reason)
{
// Do some checks first. Make sure the types are defined.
+ if (rhs != NULL
+ && rhs->forwarded()->forward_declaration_type() == NULL
+ && rhs->is_void_type())
+ {
+ if (reason != NULL)
+ *reason = "non-value used as value";
+ return false;
+ }
+
if (lhs != NULL && lhs->forwarded()->forward_declaration_type() == NULL)
{
// Any value may be assigned to the blank identifier.