Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNotInHeapDeref (0.22 sec)

  1. src/reflect/nih_test.go

    //go:build cgo
    
    package reflect_test
    
    import (
    	. "reflect"
    	"runtime/cgo"
    	"testing"
    	"unsafe"
    )
    
    type nih struct {
    	_ cgo.Incomplete
    	x int
    }
    
    var global_nih = nih{x: 7}
    
    func TestNotInHeapDeref(t *testing.T) {
    	// See issue 48399.
    	v := ValueOf((*nih)(nil))
    	v.Elem()
    	shouldPanic("reflect: call of reflect.Value.Field on zero Value", func() { v.Elem().Field(0) })
    
    	v = ValueOf(&global_nih)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 01:16:54 UTC 2022
    - 1004 bytes
    - Viewed (0)
Back to top