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
dcc064fe
Commit
dcc064fe
authored
Dec 19, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmp [] to nil
R=r OCL=21567 CL=21567
parent
78fc888e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
cgen.c
src/cmd/6g/cgen.c
+14
-0
const.c
src/cmd/gc/const.c
+10
-4
walk.c
src/cmd/gc/walk.c
+4
-0
No files found.
src/cmd/6g/cgen.c
View file @
dcc064fe
...
@@ -750,6 +750,20 @@ bgen(Node *n, int true, Prog *to)
...
@@ -750,6 +750,20 @@ bgen(Node *n, int true, Prog *to)
nr
=
r
;
nr
=
r
;
}
}
if
(
isdarray
(
nl
->
type
))
{
a
=
optoas
(
a
,
types
[
tptr
]);
regalloc
(
&
n1
,
types
[
tptr
],
N
);
agen
(
nl
,
&
n1
);
n2
=
n1
;
n2
.
op
=
OINDREG
;
n2
.
xoffset
=
offsetof
(
Array
,
array
);
nodconst
(
&
tmp
,
types
[
tptr
],
0
);
gins
(
optoas
(
OCMP
,
types
[
tptr
]),
&
n2
,
&
tmp
);
patch
(
gbranch
(
a
,
types
[
tptr
]),
to
);
regfree
(
&
n1
);
break
;
}
a
=
optoas
(
a
,
nr
->
type
);
a
=
optoas
(
a
,
nr
->
type
);
if
(
nr
->
ullman
>=
UINF
)
{
if
(
nr
->
ullman
>=
UINF
)
{
...
...
src/cmd/gc/const.c
View file @
dcc064fe
...
@@ -63,11 +63,17 @@ convlit1(Node *n, Type *t, int conv)
...
@@ -63,11 +63,17 @@ convlit1(Node *n, Type *t, int conv)
case
Wlitnil
:
case
Wlitnil
:
if
(
isptrto
(
t
,
TSTRING
))
if
(
isptrto
(
t
,
TSTRING
))
goto
bad1
;
goto
bad1
;
if
(
isptr
[
et
])
switch
(
et
)
{
break
;
default:
if
(
et
==
TINTER
)
goto
bad1
;
case
TPTR32
:
case
TPTR64
:
case
TINTER
:
case
TARRAY
:
break
;
break
;
goto
bad1
;
}
break
;
case
Wlitstr
:
case
Wlitstr
:
if
(
isnilinter
(
t
))
{
if
(
isnilinter
(
t
))
{
...
...
src/cmd/gc/walk.c
View file @
dcc064fe
...
@@ -1033,6 +1033,10 @@ loop:
...
@@ -1033,6 +1033,10 @@ loop:
case
ONE
:
case
ONE
:
if
(
n
->
left
->
type
==
T
)
if
(
n
->
left
->
type
==
T
)
goto
ret
;
goto
ret
;
if
(
isdarray
(
n
->
left
->
type
))
{
t
=
types
[
TBOOL
];
break
;
}
et
=
n
->
left
->
type
->
etype
;
et
=
n
->
left
->
type
->
etype
;
if
(
!
okforeq
[
et
])
if
(
!
okforeq
[
et
])
goto
badt
;
goto
badt
;
...
...
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