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
6d8b8101
Commit
6d8b8101
authored
Jun 23, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: fix crash for nested complex division
R=ken2 CC=golang-dev
https://golang.org/cl/1720043
parent
6e83100a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
cplx.c
src/cmd/gc/cplx.c
+1
-1
cplx4.go
test/ken/cplx4.go
+6
-0
No files found.
src/cmd/gc/cplx.c
View file @
6d8b8101
...
...
@@ -184,6 +184,7 @@ complexgen(Node *n, Node *res)
case
OINDEX
:
case
OIND
:
case
ONAME
:
// PHEAP or PPARAMREF var
case
OCALLFUNC
:
igen
(
n
,
&
n1
,
res
);
complexmove
(
&
n1
,
res
);
regfree
(
&
n1
);
...
...
@@ -245,7 +246,6 @@ complexgen(Node *n, Node *res)
case
OMUL
:
complexmul
(
nl
,
nr
,
res
);
break
;
// ODIV call a runtime function
}
}
...
...
test/ken/cplx4.go
View file @
6d8b8101
...
...
@@ -35,4 +35,10 @@ func main() {
// real, imag, cmplx
c3
:=
cmplx
(
real
(
c2
)
+
3
,
imag
(
c2
)
-
5
)
+
c2
fmt
.
Printf
(
"c = %G
\n
"
,
c3
)
// compiler used to crash on nested divide
c4
:=
cmplx
(
real
(
c3
/
2
),
imag
(
c3
/
2
))
if
c4
!=
c3
/
2
{
fmt
.
Printf
(
"c3 = %G != c4 = %G
\n
"
,
c3
,
c4
)
}
}
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