Skip to content

Commit 1f0c044

Browse files
ianlancetaylorgopherbot
authored andcommitted
test: add test that caused gofrontend to crash
Apparently people don't tend to pass untyped constant expressions to panic. For #68734 Change-Id: I6fff8137a0f001391de9e61860b67026a9db08c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/603096 Reviewed-by: David Chase <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]>
1 parent 677e080 commit 1f0c044

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/fixedbugs/issue68734.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// compile
2+
3+
// Copyright 2024 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+
// The gofrontend had a bug handling panic of an untyped constant expression.
8+
9+
package issue68734
10+
11+
func F1() {
12+
panic(1 + 2)
13+
}
14+
15+
func F2() {
16+
panic("a" + "b")
17+
}

0 commit comments

Comments
 (0)