Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 628 for recovery (0.12 sec)

  1. test/fixedbugs/issue14725.go

    package main
    
    import "fmt"
    
    func f1() (x int) {
    	for {
    		defer func() {
    			recover()
    			x = 1
    		}()
    		panic(nil)
    	}
    }
    
    var sink *int
    
    func f2() (x int) {
    	sink = &x
    	defer func() {
    		recover()
    		x = 1
    	}()
    	panic(nil)
    }
    
    func f3(b bool) (x int) {
    	sink = &x
    	defer func() {
    		recover()
    		x = 1
    	}()
    	if b {
    		panic(nil)
    	}
    	return
    }
    
    func main() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 856 bytes
    - Viewed (0)
  2. src/testing/helperfuncs_test.go

    	t.Run("sub2", func(t *testing.T) {
    		t.Helper()
    		t.Fatal(msg)
    	})
    }
    
    func recoverHelper(t *testing.T, msg string) {
    	t.Helper()
    	defer func() {
    		t.Helper()
    		if err := recover(); err != nil {
    			t.Errorf("recover %s", err)
    		}
    	}()
    	doPanic(t, msg)
    }
    
    func doPanic(t *testing.T, msg string) {
    	t.Helper()
    	panic(msg)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 17:24:47 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  3. test/fixedbugs/gcc61248.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // PR61248: Transformations to recover calls made them fail typechecking in gccgo.
    
    package main
    
    func main() {
    	var f func(int, interface{})
    	go f(0, recover())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 336 bytes
    - Viewed (0)
  4. test/fixedbugs/issue65962.go

    	if _, ok := x.(T); ok {
    	}
    }
    
    func isI(x any) {
    	_ = x.(I)
    }
    
    func test1() {
    	defer func() { recover() }()
    	ld[bool]() // add <bool,I> itab to binary
    	_ = any(false).(I)
    }
    
    type B bool
    
    func (B) f() {
    }
    func (B) g() {
    }
    
    func test2() {
    	defer func() { recover() }()
    	ld[B]() // add <B,I> itab to binary
    	_ = any(B(false)).(I)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 18:30:40 UTC 2024
    - 625 bytes
    - Viewed (0)
  5. test/fixedbugs/issue8048.go

    	test3()
    }
    
    func test1() {
    	// test1f will panic without its own defer.
    	// The runtime.GC checks that we can walk the stack
    	// at that point and not get confused.
    	// The recover lets test1 exit normally.
    	defer func() {
    		runtime.GC()
    		recover()
    	}()
    	test1f()
    }
    
    func test1f() {
    	// Because b == false, the if does not execute,
    	// so x == nil, so the println(*x) faults reading
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 2K bytes
    - Viewed (0)
  6. platforms/core-execution/persistent-cache/src/main/java/org/gradle/cache/internal/DefaultMultiProcessSafeIndexedCache.java

            // Use writeFile because the cache can internally recover from datafile
            // corruption, so we don't care at this level if it's corrupt
            fileAccess.writeFile(() -> cache.put(key, value));
        }
    
        @Override
        public void remove(final K key) {
            final BTreePersistentIndexedCache<K, V> cache = getCache();
            // Use writeFile because the cache can internally recover from datafile
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 16 15:49:50 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  7. src/crypto/internal/boring/boring_test.go

    func TestInit(t *testing.T) {}
    
    // Test that Unreachable panics.
    func TestUnreachable(t *testing.T) {
    	defer func() {
    		if Enabled {
    			if err := recover(); err == nil {
    				t.Fatal("expected Unreachable to panic")
    			}
    		} else {
    			if err := recover(); err != nil {
    				t.Fatalf("expected Unreachable to be a no-op")
    			}
    		}
    	}()
    	Unreachable()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 17 15:22:22 UTC 2017
    - 842 bytes
    - Viewed (0)
  8. test/fixedbugs/issue47712.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package p
    
    func f() {
    	if false {
    		defer func() {
    			_ = recover()
    		}()
    	}
    }
    
    func g() {
    	for false {
    		defer func() {
    			_ = recover()
    		}()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 16 18:20:12 UTC 2021
    - 321 bytes
    - Viewed (0)
  9. test/fixedbugs/bug301.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // https://golang.org/issue/990
    
    package main
    
    func main() {
    	defer func() {
    		if recover() != nil {
    			panic("non-nil recover")
    		}
    	}()
    	panic(nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 324 bytes
    - Viewed (0)
  10. src/testing/run_example.go

    		outC <- buf.String()
    	}()
    
    	finished := false
    	start := time.Now()
    
    	// Clean up in a deferred call so we can recover if the example panics.
    	defer func() {
    		timeSpent := time.Since(start)
    
    		// Close pipe, restore stdout, get output.
    		w.Close()
    		os.Stdout = stdout
    		out := <-outC
    
    		err := recover()
    		ok = eg.processRunResult(out, timeSpent, finished, err)
    	}()
    
    	// Run example.
    	eg.F()
    	finished = true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 1.3K bytes
    - Viewed (0)
Back to top