aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-12-21 16:21:24 -0800
committerIan Lance Taylor <iant@golang.org>2020-12-21 16:21:58 -0800
commit30b76d90596178c3a71910104326c12a4a2ac25f (patch)
tree46234d9db1d7c9809592a510fc4253de74547d5f /gcc
parent03ea48ff27fd40b04b148f7006a02513a887ad0d (diff)
downloadgcc-30b76d90596178c3a71910104326c12a4a2ac25f.zip
gcc-30b76d90596178c3a71910104326c12a4a2ac25f.tar.gz
gcc-30b76d90596178c3a71910104326c12a4a2ac25f.tar.bz2
-fdump-go-spec: don't crash if DECL_ORIGINAL_TYPE is NULL
* godump.c (go_output_typedef): If DECL_ORIGINAL_TYPE is NULL, use TREE_TYPE.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/godump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/godump.c b/gcc/godump.c
index ff3a4a9..a59f9a0 100644
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -1159,6 +1159,8 @@ go_output_typedef (class godump_container *container, tree decl)
type = IDENTIFIER_POINTER (DECL_NAME (decl));
original_type = DECL_ORIGINAL_TYPE (decl);
+ if (original_type == NULL_TREE)
+ original_type = TREE_TYPE (decl);
/* Suppress typedefs where the type name matches the underlying
struct/union/enum tag. This way we'll emit the struct definition