compiler: panic arguments are empty interface type

After CL 536643 passing NULL as the expected type permitted an untyped
constant expression to remain untyped. Change to passing the empty
interface type.

The panic and print/println functions are the only builtin functions
that turn an untyped constant expression into a regular function call,
and we already handled print/println specially.

The test case is https://go.dev/cl/603096.

Fixes golang/go#68734

Change-Id: I02f353425b1f4cb8253ab7b29d707d93ede62f72
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/603215
Reviewed-by: Than McIntosh <thanm@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
1 file changed
tree: d92ed1a72249eba533a34ccbdf6d8289e464228c
  1. go/
  2. libgo/
  3. .gitignore
  4. codereview.cfg
  5. HACKING
  6. LICENSE
  7. PATENTS
  8. README.md
README.md

A Go frontend

Ian Lance Taylor Last update 15 June 2014

This is a compiler frontend for the Go programming language. The frontend was originally developed at Google, and was released in November 2009. It was originally written by Ian Lance Taylor.

It was originally written for GCC. As of this writing it only supports GCC, but the GCC support has been separated from the rest of the frontend, so supporting another compiler is feasible.

The go subdirectory holds the frontend source code. This is mirrored to the gcc/go subdirectory in the GCC repository.

The libgo subdirectory holds the library source code. This is a copy of the main Go library with various changes appropriate for this compiler. The main Go library is hosted at http://go.googlesource.com/go, in the src directory. The libgo subdirectory is mirrored to the libgo subdirectory in the gcc repository.

Legal Matters

To contribute patches to the files in this directory, please see Contributing to the gccgo frontend.

The master copy of these files is hosted in Gerrit (there is a mirror at Github). Changes to these files require signing a Google contributor license agreement. If you are the copyright holder, you will need to agree to the Google Individual Contributor License Agreement. This agreement can be completed online.

If your organization is the copyright holder, the organization will need to agree to the Google Software Grant and Corporate Contributor License Agreement.

If the copyright holder for your code has already completed the agreement in connection with another Google open source project, it does not need to be completed again.