Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
bedcedc1
Commit
bedcedc1
authored
Mar 01, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Fix handling of indirection of circular types.
From-SVN: r184686
parent
ce842ad6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
gcc/go/gofrontend/expressions.cc
+6
-2
No files found.
gcc/go/gofrontend/expressions.cc
View file @
bedcedc1
...
@@ -4705,7 +4705,10 @@ Unary_expression::do_get_tree(Translate_context* context)
...
@@ -4705,7 +4705,10 @@ Unary_expression::do_get_tree(Translate_context* context)
// need to check for nil. We don't bother to check for small
// need to check for nil. We don't bother to check for small
// structs because we expect the system to crash on a nil
// structs because we expect the system to crash on a nil
// pointer dereference.
// pointer dereference.
HOST_WIDE_INT
s
=
int_size_in_bytes
(
TREE_TYPE
(
TREE_TYPE
(
expr
)));
tree
target_type_tree
=
TREE_TYPE
(
TREE_TYPE
(
expr
));
if
(
!
VOID_TYPE_P
(
target_type_tree
))
{
HOST_WIDE_INT
s
=
int_size_in_bytes
(
target_type_tree
);
if
(
s
==
-
1
||
s
>=
4096
)
if
(
s
==
-
1
||
s
>=
4096
)
{
{
if
(
!
DECL_P
(
expr
))
if
(
!
DECL_P
(
expr
))
...
@@ -4724,10 +4727,11 @@ Unary_expression::do_get_tree(Translate_context* context)
...
@@ -4724,10 +4727,11 @@ Unary_expression::do_get_tree(Translate_context* context)
NULL_TREE
),
NULL_TREE
),
expr
);
expr
);
}
}
}
// If the type of EXPR is a recursive pointer type, then we
// If the type of EXPR is a recursive pointer type, then we
// need to insert a cast before indirecting.
// need to insert a cast before indirecting.
if
(
TREE_TYPE
(
TREE_TYPE
(
expr
))
==
ptr_type_node
)
if
(
VOID_TYPE_P
(
target_type_tree
)
)
{
{
Type
*
pt
=
this
->
expr_
->
type
()
->
points_to
();
Type
*
pt
=
this
->
expr_
->
type
()
->
points_to
();
tree
ind
=
type_to_tree
(
pt
->
get_backend
(
context
->
gogo
()));
tree
ind
=
type_to_tree
(
pt
->
get_backend
(
context
->
gogo
()));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment