github.com/shijuvar/go@v0.0.0-20141209052335-e8f13700b70c/src/runtime/os_windows.go (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package runtime 6 7 type stdFunction *byte 8 9 func os_sigpipe() { 10 gothrow("too many writes on closed pipe") 11 } 12 13 func sigpanic() { 14 g := getg() 15 if !canpanic(g) { 16 gothrow("unexpected signal during runtime execution") 17 } 18 19 switch uint32(g.sig) { 20 case _EXCEPTION_ACCESS_VIOLATION: 21 if g.sigcode1 < 0x1000 || g.paniconfault { 22 panicmem() 23 } 24 print("unexpected fault address ", hex(g.sigcode1), "\n") 25 gothrow("fault") 26 case _EXCEPTION_INT_DIVIDE_BY_ZERO: 27 panicdivide() 28 case _EXCEPTION_INT_OVERFLOW: 29 panicoverflow() 30 case _EXCEPTION_FLT_DENORMAL_OPERAND, 31 _EXCEPTION_FLT_DIVIDE_BY_ZERO, 32 _EXCEPTION_FLT_INEXACT_RESULT, 33 _EXCEPTION_FLT_OVERFLOW, 34 _EXCEPTION_FLT_UNDERFLOW: 35 panicfloat() 36 } 37 gothrow("fault") 38 }