Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
d116a327
Commit
d116a327
authored
Nov 20, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: reject large channel values at compile time
Fixes #144. R=ken2 CC=agl1
https://golang.org/cl/156102
parent
a6e1ad27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
align.c
src/cmd/gc/align.c
+12
-0
go.h
src/cmd/gc/go.h
+1
-0
No files found.
src/cmd/gc/align.c
View file @
d116a327
...
...
@@ -186,6 +186,18 @@ dowidth(Type *t)
case
TCHAN
:
// implemented as pointer
w
=
widthptr
;
checkwidth
(
t
->
type
);
// make fake type to check later to
// trigger channel argument check.
t1
=
typ
(
TCHANARGS
);
t1
->
type
=
t
;
checkwidth
(
t1
);
break
;
case
TCHANARGS
:
t1
=
t
->
type
;
dowidth
(
t
->
type
);
// just in case
if
(
t1
->
type
->
width
>=
(
1
<<
16
))
yyerror
(
"channel element type too large (>64kB)"
);
break
;
case
TMAP
:
// implemented as pointer
w
=
widthptr
;
...
...
src/cmd/gc/go.h
View file @
d116a327
...
...
@@ -441,6 +441,7 @@ enum
// pseudo-type for frame layout
TFUNCARGS
,
TCHANARGS
,
NTYPE
,
};
...
...
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