From 633b742ae084df018c802c97bdbe91cf5f598605 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 21 Jun 2023 13:52:42 -0700 Subject: [PATCH] test: add test that caused a gofrontend crash Change-Id: Idd872c5b90dbca564ed8a37bb3683e642142ae63 Reviewed-on: https://go-review.googlesource.com/c/go/+/505015 Reviewed-by: Than McIntosh Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor --- test/fixedbugs/bug516.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/fixedbugs/bug516.go diff --git a/test/fixedbugs/bug516.go b/test/fixedbugs/bug516.go new file mode 100644 index 0000000000..e52eb215ef --- /dev/null +++ b/test/fixedbugs/bug516.go @@ -0,0 +1,13 @@ +// compile + +// Copyright 2023 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. + +// Caused a gofrontend crash. + +package p + +func F(b []byte, i int) { + *(*[1]byte)(b[i*2:]) = [1]byte{} +} -- 2.50.0