Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 37 for Hancic (0.17 sec)

  1. src/cmd/cgo/internal/test/callback_c_gc.c

    #include <stdint.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    /* Test calling panic from C.  This is what SWIG does.  */
    
    extern void crosscall2(void (*fn)(void *, int), void *, int);
    extern void _cgo_panic(void *, int);
    extern void _cgo_allocate(void *, int);
    
    void
    callPanic(void)
    {
    	struct { const char *p; } a;
    	a.p = "panic from C";
    	crosscall2(_cgo_panic, &a, sizeof a);
    	*(int*)1 = 1;
    C
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri May 12 12:00:02 GMT 2023
    - 592 bytes
    - Viewed (0)
  2. src/bytes/buffer_test.go

    	}
    }
    
    type panicReader struct{ panic bool }
    
    func (r panicReader) Read(p []byte) (int, error) {
    	if r.panic {
    		panic("oops")
    	}
    	return 0, io.EOF
    }
    
    // Make sure that an empty Buffer remains empty when
    // it is "grown" before a Read that panics
    func TestReadFromPanicReader(t *testing.T) {
    
    	// First verify non-panic behaviour
    	var buf Buffer
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 20 01:07:29 GMT 2023
    - 18.1K bytes
    - Viewed (0)
  3. src/bufio/bufio_test.go

    func TestNegativeRead(t *testing.T) {
    	// should panic with a description pointing at the reader, not at itself.
    	// (should NOT panic with slice index error, for example.)
    	b := NewReader(new(negativeReader))
    	defer func() {
    		switch err := recover().(type) {
    		case nil:
    			t.Fatal("read did not panic")
    		case error:
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/test/callback.go

    	}
    	defer func() {
    		s := recover()
    		if s == nil {
    			t.Fatal("did not panic")
    		}
    		if s.(string) != "callback panic" {
    			t.Fatal("wrong panic:", s)
    		}
    		if !lockedOSThread() {
    			t.Fatal("lost lock on OS thread after panic")
    		}
    	}()
    	nestedCall(func() { panic("callback panic") })
    	panic("nestedCall returned")
    }
    
    // Callback with zero arguments used to make the stack misaligned,
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri May 12 12:00:02 GMT 2023
    - 111.5K bytes
    - Viewed (0)
  5. src/bufio/export_test.go

    // Exported for testing only.
    import (
    	"unicode/utf8"
    )
    
    var IsSpace = isSpace
    
    const DefaultBufSize = defaultBufSize
    
    func (s *Scanner) MaxTokenSize(n int) {
    	if n < utf8.UTFMax || n > 1e9 {
    		panic("bad max token size")
    	}
    	if n < len(s.buf) {
    		s.buf = make([]byte, n)
    	}
    	s.maxTokenSize = n
    }
    
    // ErrOrEOF is like Err, but returns EOF. Used to test a corner case.
    func (s *Scanner) ErrOrEOF() error {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Nov 02 17:17:44 GMT 2017
    - 597 bytes
    - Viewed (0)
  6. src/cmd/cgo/ast_go118.go

    	"go/token"
    )
    
    func (f *File) walkUnexpected(x interface{}, context astContext, visit func(*File, interface{}, astContext)) {
    	switch n := x.(type) {
    	default:
    		error_(token.NoPos, "unexpected type %T in walk", x)
    		panic("unexpected type")
    
    	case *ast.IndexListExpr:
    		f.walk(&n.X, ctxExpr, visit)
    		f.walk(n.Indices, ctxExpr, visit)
    	}
    }
    
    func funcTypeTypeParams(n *ast.FuncType) *ast.FieldList {
    	return n.TypeParams
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Nov 30 21:45:10 GMT 2022
    - 730 bytes
    - Viewed (0)
  7. doc/go1.17_spec.html

    At that point, the program is terminated and the error
    condition is reported, including the value of the argument to <code>panic</code>.
    This termination sequence is called <i>panicking</i>.
    </p>
    
    <pre>
    panic(42)
    panic("unreachable")
    panic(Error("cannot parse"))
    </pre>
    
    <p>
    The <code>recover</code> function allows a program to manage behavior
    of a panicking goroutine.
    HTML
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  8. src/archive/zip/reader_test.go

    	b, err := hex.DecodeString(s)
    	if err != nil {
    		panic(err)
    	}
    	return b
    }
    
    func returnBigZipBytes() (r io.ReaderAt, size int64) {
    	b := biggestZipBytes()
    	for i := 0; i < 2; i++ {
    		r, err := NewReader(bytes.NewReader(b), int64(len(b)))
    		if err != nil {
    			panic(err)
    		}
    		f, err := r.File[0].Open()
    		if err != nil {
    			panic(err)
    		}
    		b, err = io.ReadAll(f)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 55.3K bytes
    - Viewed (0)
  9. src/arena/arena.go

    // allocated from an arena, it is returned untouched. This function is useful
    // to more easily let an arena-allocated value out-live its arena.
    // T must be a pointer, a slice, or a string, otherwise this function will panic.
    func Clone[T any](s T) T {
    	return runtime_arena_heapify(s).(T)
    }
    
    //go:linkname reflect_arena_New reflect.arena_New
    func reflect_arena_New(a *Arena, typ any) any {
    	return runtime_arena_arena_New(a.a, typ)
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Oct 12 20:23:36 GMT 2022
    - 4.3K bytes
    - Viewed (0)
  10. src/cmd/api/api_test.go

    			t.Fatalf("stdPackages contains unexpected package %s", pkg)
    		}
    	}
    }
    
    func TestIssue64958(t *testing.T) {
    	defer func() {
    		if x := recover(); x != nil {
    			t.Errorf("expected no panic; recovered %v", x)
    		}
    	}()
    
    	testenv.MustHaveGoBuild(t)
    
    	for _, context := range contexts {
    		w := NewWalker(context, "testdata/src/issue64958")
    		pkg, err := w.importFrom("p", "", 0)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Jan 04 17:31:12 GMT 2024
    - 7.1K bytes
    - Viewed (0)
Back to top