summaryrefslogtreecommitdiff
path: root/test/nilptr/arrayindex.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/nilptr/arrayindex.go')
-rw-r--r--test/nilptr/arrayindex.go7
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
}