Source file test/fixedbugs/issue44344.go

     1  // compile
     2  
     3  // Copyright 2021 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // Issue #44344: a crash in DWARF scope generation (trying to
     8  // scope the PCs of a function that was inlined away).
     9  
    10  package main
    11  
    12  func main() {
    13  	pv := []int{3, 4, 5}
    14  	if pv[1] != 9 {
    15  		pv = append(pv, 9)
    16  	}
    17  	tryit := func() bool {
    18  		lpv := len(pv)
    19  		if lpv == 101 {
    20  			return false
    21  		}
    22  		if worst := pv[pv[1]&1]; worst != 101 {
    23  			return true
    24  		}
    25  		return false
    26  	}()
    27  	if tryit {
    28  		println(pv[0])
    29  	}
    30  }
    31  

View as plain text