Index: test/nilptr/structfield1.go |
=================================================================== |
--- a/test/nilptr/structfield1.go |
+++ b/test/nilptr/structfield1.go |
@@ -10,14 +10,14 @@ |
import "unsafe" |
-var dummy [512<<20]byte; // give us a big address space |
+var dummy [512<<20]byte // give us a big address space |
type T struct { |
- x [256<<20] byte; |
- i int; |
+ x [256<<20] byte |
+ i int |
} |
func f() *T { |
- return nil; |
+ return nil |
} |
func main() { |
@@ -27,12 +27,12 @@ |
// at the address that might be accidentally |
// dereferenced below. |
if uintptr(unsafe.Pointer(&dummy)) > 256<<20 { |
- panic("dummy too far out"); |
+ panic("dummy too far out") |
} |
// The problem here is that indexing into t with a large |
// enough index can jump out of the unmapped section |
// at the beginning of memory and into valid memory. |
// We require the pointer dereference to check. |
- println(f().i); // should crash |
+ println(f().i) // should crash |
} |