diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2014-09-15 12:58:28 +1000 |
---|---|---|
committer | Alex Brainman <alex.brainman@gmail.com> | 2014-09-15 12:58:28 +1000 |
commit | 5d5312c5dd979f8ae37482f0fc938587aeb5a245 (patch) | |
tree | dd8fedc159ae50808ea3064d35183cabd7102f2b /src/runtime/syscall_windows.go | |
parent | 3b4bccc82061fd1f9c70a1b6e85efbdd2ded51a2 (diff) | |
download | go-5d5312c5dd979f8ae37482f0fc938587aeb5a245.tar.gz go-5d5312c5dd979f8ae37482f0fc938587aeb5a245.zip |
runtime: fix parameter checking in syscall.NewCallback
I have made mistake while converting it to Go (CL 132820043).
Added test as penance for my sin.
LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/136560043
Diffstat (limited to 'src/runtime/syscall_windows.go')
-rw-r--r-- | src/runtime/syscall_windows.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/syscall_windows.go b/src/runtime/syscall_windows.go index 959c675f4f..efbcab510d 100644 --- a/src/runtime/syscall_windows.go +++ b/src/runtime/syscall_windows.go @@ -53,7 +53,7 @@ func compileCallback(fn eface, cleanstack bool) (code uintptr) { } argsize := uintptr(0) for _, t := range (*[1024](*_type))(unsafe.Pointer(&ft.in[0]))[:len(ft.in)] { - if (*t).size != uintptrSize { + if (*t).size > uintptrSize { panic("compilecallback: input parameter size is wrong") } argsize += uintptrSize |