Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Unified Diff: test/nilptr/structfield1.go

Issue 2157041: code review 2157041: test: remove semiocolons. (Closed)
Patch Set: code review 2157041: test: remove semiocolons. Created 14 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/nilptr/structfield.go ('k') | test/nilptr/structfield2.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « test/nilptr/structfield.go ('k') | test/nilptr/structfield2.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b