mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: replace C.malloc with our own wrapper
This allows us to make two changes: 1. Force the argument type to be size_t, even on broken systems that declare malloc to take a ulong. 2. Call runtime.throw if malloc fails. (That is, the program crashes; it does not panic.) Fixes #3403. Fixes #5926. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13413047
This commit is contained in:
parent
89b26760d7
commit
397ba2cb4a
4 changed files with 48 additions and 3 deletions
|
|
@ -341,7 +341,7 @@ func (p *Package) Record(f *File) {
|
|||
if p.Name[k] == nil {
|
||||
p.Name[k] = v
|
||||
} else if !reflect.DeepEqual(p.Name[k], v) {
|
||||
error_(token.NoPos, "inconsistent definitions for C.%s", k)
|
||||
error_(token.NoPos, "inconsistent definitions for C.%s", fixGo(k))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue