1
0
mirror of https://github.com/golang/go synced 2024-11-26 03:57:57 -07:00

- added bug093.go

R=r
DELTA=80  (78 added, 2 deleted, 0 changed)
OCL=15094
CL=15101
This commit is contained in:
Robert Griesemer 2008-09-10 14:21:42 -07:00
parent 92ae2cc8a3
commit e35139afd4
2 changed files with 82 additions and 2 deletions

64
test/bugs/bug093.go Normal file
View File

@ -0,0 +1,64 @@
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: fails incorrectly
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
type S struct {
}
func (p *S) M() {
print("M\n");
}
type I interface {
M();
}
func main() {
var p *S = nil;
var i I = p; // this should be possible even though p is nil: we still know the type
i.M(); // should be possible since we know the type, and don't ever use the receiver
}
/*
throw: ifaces2i: nil pointer
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x1b7d
0x1b7d?zi
throw(30409, 0, 0, ...)
throw(0x76c9, 0x0, 0x0, ...)
0x207f?zi
sys·ifaces2i(31440, 0, 31480, ...)
sys·ifaces2i(0x7ad0, 0x7af8, 0x0, ...)
0x136f?zi
main·main(1, 0, 1606416424, ...)
main·main(0x1, 0x7fff5fbff828, 0x0, ...)
rax 0x1
rbx 0x1
rcx 0x33b5
rdx 0x0
rdi 0x1
rsi 0x7684
rbp 0x7684
rsp 0xafb8
r8 0x0
r9 0x0
r10 0x1002
r11 0x206
r12 0x0
r13 0x0
r14 0x7c48
r15 0xa000
rip 0x1b7d
rflags 0x10202
cs 0x27
fs 0x10
gs 0x48
*/

View File

@ -78,7 +78,6 @@ BUG: compilation should succeed
bugs/bug074.go:6: syntax error bugs/bug074.go:6: syntax error
bugs/bug074.go:7: x: undefined bugs/bug074.go:7: x: undefined
BUG: compiler crashes - Bus error BUG: compiler crashes - Bus error
Bus error $G $D/$F.go
=========== bugs/bug075.go =========== bugs/bug075.go
bugs/bug075.go:11: bad shape across assignment - cr=1 cl=2 bugs/bug075.go:11: bad shape across assignment - cr=1 cl=2
@ -103,7 +102,6 @@ BUG: succeeds incorrectly
=========== bugs/bug085.go =========== bugs/bug085.go
bugs/bug085.go:8: P: undefined bugs/bug085.go:8: P: undefined
BUG: fails incorrectly BUG: fails incorrectly
Bus error $G $D/$F.go
=========== bugs/bug086.go =========== bugs/bug086.go
4882 4882
@ -125,6 +123,24 @@ BUG: fails incorrectly
=========== bugs/bug090.go =========== bugs/bug090.go
BUG: compilation succeeds incorrectly BUG: compilation succeeds incorrectly
=========== bugs/bug093.go
throw: ifaces2i: nil pointer
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x1b7d
0x1b7d?zi
throw(30409, 0, 0, ...)
throw(0x76c9, 0x0, 0x0, ...)
0x207f?zi
sys·ifaces2i(31440, 0, 31480, ...)
sys·ifaces2i(0x7ad0, 0x7af8, 0x0, ...)
0x136f?zi
main·main(1, 0, 1606416392, ...)
main·main(0x1, 0x7fff5fbff808, 0x0, ...)
BUG: fails incorrectly
=========== fixedbugs/bug015.go =========== fixedbugs/bug015.go
fixedbugs/bug015.go:7: overflow converting constant to <int64>INT64 fixedbugs/bug015.go:7: overflow converting constant to <int64>INT64