]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: don't crash when calling String on a TFUNCARGS Type
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Mar 2017 03:33:23 +0000 (20:33 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Mar 2017 19:12:46 +0000 (19:12 +0000)
Change-Id: If5eabd622700a6b82dc4961ae9174c9d907eedb7
Reviewed-on: https://go-review.googlesource.com/38465
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/fmt.go

index 6932f6de2c2a8a37eed8e7135b116f71fb117b2d..16f61b90f0e705c2de822c26eceb4677cb42e8d4 100644 (file)
@@ -339,7 +339,7 @@ func (m fmtMode) prepareArgs(args []interface{}) {
                                args[i] = (*fmtSymErr)(arg)
                        case Nodes:
                                args[i] = fmtNodesErr(arg)
-                       case Val, int32, int64, string:
+                       case Val, int32, int64, string, EType:
                                // OK: printing these types doesn't depend on mode
                        default:
                                Fatalf("mode.prepareArgs type %T", arg)
@@ -358,7 +358,7 @@ func (m fmtMode) prepareArgs(args []interface{}) {
                                args[i] = (*fmtSymDbg)(arg)
                        case Nodes:
                                args[i] = fmtNodesDbg(arg)
-                       case Val, int32, int64, string:
+                       case Val, int32, int64, string, EType:
                                // OK: printing these types doesn't depend on mode
                        default:
                                Fatalf("mode.prepareArgs type %T", arg)
@@ -377,7 +377,7 @@ func (m fmtMode) prepareArgs(args []interface{}) {
                                args[i] = (*fmtSymTypeId)(arg)
                        case Nodes:
                                args[i] = fmtNodesTypeId(arg)
-                       case Val, int32, int64, string:
+                       case Val, int32, int64, string, EType:
                                // OK: printing these types doesn't depend on mode
                        default:
                                Fatalf("mode.prepareArgs type %T", arg)
@@ -396,7 +396,7 @@ func (m fmtMode) prepareArgs(args []interface{}) {
                                args[i] = (*fmtSymTypeIdName)(arg)
                        case Nodes:
                                args[i] = fmtNodesTypeIdName(arg)
-                       case Val, int32, int64, string:
+                       case Val, int32, int64, string, EType:
                                // OK: printing these types doesn't depend on mode
                        default:
                                Fatalf("mode.prepareArgs type %T", arg)
@@ -935,7 +935,7 @@ func (t *Type) typefmt(flag FmtFlag, mode fmtMode) string {
        }
 
        // Don't know how to handle - fall back to detailed prints.
-       return mode.Sprintf("%v <%v> %v", t.Etype, t.Sym, t.Elem())
+       return mode.Sprintf("%v <%v>", t.Etype, t.Sym)
 }
 
 // Statements which may be rendered with a simplestmt as init.