Merge pull request #38013 from jiria/jiria/enable-32bit-arch-on-windows
Properly type handles to prevent overflows on 32 bit Windows targets
This commit is contained in:
commit
e28d9a479f
1 changed files with 3 additions and 3 deletions
|
@ -396,8 +396,8 @@ func initPanicFile(path string) error {
|
|||
// Update STD_ERROR_HANDLE to point to the panic file so that Go writes to
|
||||
// it when it panics. Remember the old stderr to restore it before removing
|
||||
// the panic file.
|
||||
sh := windows.STD_ERROR_HANDLE
|
||||
h, err := windows.GetStdHandle(uint32(sh))
|
||||
sh := uint32(windows.STD_ERROR_HANDLE)
|
||||
h, err := windows.GetStdHandle(sh)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ func initPanicFile(path string) error {
|
|||
func removePanicFile() {
|
||||
if st, err := panicFile.Stat(); err == nil {
|
||||
if st.Size() == 0 {
|
||||
sh := windows.STD_ERROR_HANDLE
|
||||
sh := uint32(windows.STD_ERROR_HANDLE)
|
||||
setStdHandle.Call(uintptr(sh), uintptr(oldStderr))
|
||||
panicFile.Close()
|
||||
os.Remove(panicFile.Name())
|
||||
|
|
Loading…
Add table
Reference in a new issue