diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /test/nilptr/arrayindex.go | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'test/nilptr/arrayindex.go')
-rw-r--r-- | test/nilptr/arrayindex.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/nilptr/arrayindex.go b/test/nilptr/arrayindex.go index 1767acc27..fa26532c6 100644 --- a/test/nilptr/arrayindex.go +++ b/test/nilptr/arrayindex.go @@ -1,4 +1,3 @@ -// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl // $G $D/$F.go && $L $F.$A && // ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail) @@ -13,8 +12,8 @@ import "unsafe" var x byte func main() { - var p *[1<<30]byte = nil; - x = 123; + var p *[1<<30]byte = nil + x = 123 // The problem here is not the use of unsafe: // it is that indexing into p[] with a large @@ -23,5 +22,5 @@ func main() { // Pointer offsets and array indices, if they are // very large, need to dereference the base pointer // to trigger a trap. - println(p[uintptr(unsafe.Pointer(&x))]); // should crash + println(p[uintptr(unsafe.Pointer(&x))]) // should crash } |