Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 69 for readCode (0.23 sec)

  1. src/internal/types/errors/codes_test.go

    				err := checkExample(t, example)
    				if err == nil {
    					t.Fatalf("no error in example #%d", i)
    				}
    				typerr, ok := err.(Error)
    				if !ok {
    					t.Fatalf("not a types.Error: %v", err)
    				}
    				if got := readCode(typerr); got != value {
    					t.Errorf("%s: example #%d returned code %d (%s), want %d", name, i, got, err, value)
    				}
    			}
    		})
    	})
    }
    
    func walkCodes(t *testing.T, f func(string, int, *ast.ValueSpec)) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 18 20:41:45 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  2. src/go/types/check_test.go

    			for line, errList := range filemap {
    				for _, err := range errList {
    					t.Errorf("%s:%d:%d: %s", filename, line, err.col, err.text)
    				}
    			}
    		}
    	}
    }
    
    func readCode(err Error) errors.Code {
    	v := reflect.ValueOf(err)
    	return errors.Code(v.FieldByName("go116code").Int())
    }
    
    // boolFieldAddr(conf, name) returns the address of the boolean field conf.<name>.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  3. src/cmd/vet/testdata/deadcode/deadcode.go

    // Copyright 2013 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file contains tests for the dead code checker.
    
    package deadcode
    
    func _() int {
    	print(1)
    	return 2
    	println() // ERROR "unreachable code"
    	return 3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 20 15:46:42 UTC 2019
    - 320 bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/deadcode.go

    			}
    		}
    	}
    
    	return
    }
    
    // deadcode removes dead code from f.
    func deadcode(f *Func) {
    	// deadcode after regalloc is forbidden for now. Regalloc
    	// doesn't quite generate legal SSA which will lead to some
    	// required moves being eliminated. See the comment at the
    	// top of regalloc.go for details.
    	if f.RegAlloc != nil {
    		f.Fatalf("deadcode after regalloc")
    	}
    
    	// Find reachable blocks.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 00:29:01 UTC 2023
    - 9.2K bytes
    - Viewed (0)
  5. src/cmd/link/internal/ld/deadcode.go

    		if exportsIdx != 0 {
    			relocs := d.ldr.Relocs(exportsIdx)
    			for i := 0; i < relocs.Count(); i++ {
    				d.mark(relocs.At(i).Sym(), 0)
    			}
    		}
    	}
    
    	if d.ctxt.Debugvlog > 1 {
    		d.ctxt.Logf("deadcode start names: %v\n", names)
    	}
    
    	for _, name := range names {
    		// Mark symbol as a data/ABI0 symbol.
    		d.mark(d.ldr.Lookup(name, 0), 0)
    		if abiInternalVer != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 14:52:41 UTC 2024
    - 19K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/ssa/compile.go

    	{name: "late lower", fn: lateLower, required: true},
    	{name: "lowered deadcode for cse", fn: deadcode}, // deadcode immediately before CSE avoids CSE making dead values live again
    	{name: "lowered cse", fn: cse},
    	{name: "elim unread autos", fn: elimUnreadAutos},
    	{name: "tighten tuple selectors", fn: tightenTupleSelectors, required: true},
    	{name: "lowered deadcode", fn: deadcode, required: true},
    	{name: "checkLower", fn: checkLower, required: true},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 14:55:18 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/deadcode_test.go

    			Exit("mem")),
    		// dead loop
    		Bloc("deadblock",
    			// dead value in dead block
    			Valu("deadval", OpConstBool, c.config.Types.Bool, 1, nil),
    			If("deadval", "deadblock", "exit")))
    
    	CheckFunc(fun.f)
    	Deadcode(fun.f)
    	CheckFunc(fun.f)
    
    	for _, b := range fun.f.Blocks {
    		if b == fun.blocks["deadblock"] {
    			t.Errorf("dead block not removed")
    		}
    		for _, v := range b.Values {
    			if v == fun.values["deadval"] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 23:01:51 UTC 2017
    - 3.5K bytes
    - Viewed (0)
  8. src/cmd/link/internal/ld/testdata/deadcode/globalmap.go

    package main
    
    import "os"
    
    // Too small to trigger deadcode (currently)
    var small = map[string]int{"foo": 1}
    
    // Has side effects, which prevent deadcode
    var effect = map[string]int{"foo": os.Getpid()}
    
    // Large and side-effect free
    var large = map[string]int{
    	"11": 1, "12": 2, "13": 3, "14": 4, "15": 5, "16": 6, "17": 7, "18": 8, "19": 9, "110": 10,
    	"21": 1, "22": 2, "23": 3, "24": 4, "25": 5, "26": 6, "27": 7, "28": 8, "29": 9, "210": 10,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 06 20:56:47 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  9. internal/ioutil/read_file.go

    // Because ReadFile reads the whole file, it does not treat an EOF from Read
    // as an error to be reported.
    func ReadFileWithFileInfo(name string) ([]byte, fs.FileInfo, error) {
    	f, err := OsOpenFile(name, readMode, 0o666)
    	if err != nil {
    		return nil, nil, err
    	}
    	defer f.Close()
    
    	st, err := f.Stat()
    	if err != nil {
    		return nil, nil, err
    	}
    
    	dst := make([]byte, st.Size())
    	_, err = io.ReadFull(f, dst)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 09 18:17:51 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  10. internal/ioutil/read_file_noatime_notsupported.go

    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package ioutil
    
    import "os"
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Aug 19 01:35:22 UTC 2021
    - 893 bytes
    - Viewed (0)
Back to top