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
f3fb416a
Commit
f3fb416a
authored
Feb 15, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Avoid crashes on erroneous input.
From-SVN: r184274
parent
65728e39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
gcc/go/gofrontend/backend.h
+3
-1
gcc/go/gofrontend/gogo.cc
+5
-0
gcc/go/gofrontend/types.cc
+7
-3
No files found.
gcc/go/gofrontend/backend.h
View file @
f3fb416a
...
@@ -126,7 +126,9 @@ class Backend
...
@@ -126,7 +126,9 @@ class Backend
// Fill in a placeholder pointer type as a pointer. This takes a
// Fill in a placeholder pointer type as a pointer. This takes a
// type returned by placeholder_pointer_type and arranges for it to
// type returned by placeholder_pointer_type and arranges for it to
// point to to_type. Returns true on success, false on failure.
// point to the type that TO_TYPE points to (that is, PLACEHOLDER
// becomes the same type as TO_TYPE). Returns true on success,
// false on failure.
virtual
bool
virtual
bool
set_placeholder_pointer_type
(
Btype
*
placeholder
,
Btype
*
to_type
)
=
0
;
set_placeholder_pointer_type
(
Btype
*
placeholder
,
Btype
*
to_type
)
=
0
;
...
...
gcc/go/gofrontend/gogo.cc
View file @
f3fb416a
...
@@ -4180,6 +4180,11 @@ Variable::get_backend_variable(Gogo* gogo, Named_object* function,
...
@@ -4180,6 +4180,11 @@ Variable::get_backend_variable(Gogo* gogo, Named_object* function,
package
!=
NULL
,
package
!=
NULL
,
Gogo
::
is_hidden_name
(
name
),
Gogo
::
is_hidden_name
(
name
),
this
->
location_
);
this
->
location_
);
else
if
(
function
==
NULL
)
{
go_assert
(
saw_errors
());
bvar
=
backend
->
error_variable
();
}
else
else
{
{
tree
fndecl
=
function
->
func_value
()
->
get_decl
();
tree
fndecl
=
function
->
func_value
()
->
get_decl
();
...
...
gcc/go/gofrontend/types.cc
View file @
f3fb416a
...
@@ -3595,7 +3595,7 @@ Pointer_type::do_hash_for_method(Gogo* gogo) const
...
@@ -3595,7 +3595,7 @@ Pointer_type::do_hash_for_method(Gogo* gogo) const
return
this
->
to_type_
->
hash_for_method
(
gogo
)
<<
4
;
return
this
->
to_type_
->
hash_for_method
(
gogo
)
<<
4
;
}
}
//
The tree
for a pointer type.
//
Get the backend representation
for a pointer type.
Btype
*
Btype
*
Pointer_type
::
do_get_backend
(
Gogo
*
gogo
)
Pointer_type
::
do_get_backend
(
Gogo
*
gogo
)
...
@@ -5345,6 +5345,7 @@ Array_type::do_get_backend(Gogo* gogo)
...
@@ -5345,6 +5345,7 @@ Array_type::do_get_backend(Gogo* gogo)
}
}
// Return the backend representation of the element type.
// Return the backend representation of the element type.
Btype
*
Btype
*
Array_type
::
get_backend_element
(
Gogo
*
gogo
)
Array_type
::
get_backend_element
(
Gogo
*
gogo
)
{
{
...
@@ -7567,6 +7568,11 @@ Find_type_use::type(Type* type)
...
@@ -7567,6 +7568,11 @@ Find_type_use::type(Type* type)
this
->
find_type_
->
add_dependency
(
type
->
named_type
());
this
->
find_type_
->
add_dependency
(
type
->
named_type
());
break
;
break
;
case
Type
:
:
TYPE_NAMED
:
case
Type
:
:
TYPE_FORWARD
:
go_assert
(
saw_errors
());
break
;
case
Type
:
:
TYPE_VOID
:
case
Type
:
:
TYPE_VOID
:
case
Type
:
:
TYPE_SINK
:
case
Type
:
:
TYPE_SINK
:
case
Type
:
:
TYPE_FUNCTION
:
case
Type
:
:
TYPE_FUNCTION
:
...
@@ -7575,8 +7581,6 @@ Find_type_use::type(Type* type)
...
@@ -7575,8 +7581,6 @@ Find_type_use::type(Type* type)
case
Type
:
:
TYPE_MAP
:
case
Type
:
:
TYPE_MAP
:
case
Type
:
:
TYPE_CHANNEL
:
case
Type
:
:
TYPE_CHANNEL
:
case
Type
:
:
TYPE_INTERFACE
:
case
Type
:
:
TYPE_INTERFACE
:
case
Type
:
:
TYPE_NAMED
:
case
Type
:
:
TYPE_FORWARD
:
default
:
default
:
go_unreachable
();
go_unreachable
();
}
}
...
...
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