Daniel Martí
ba6974fdc3
cmd/compile: fix crash on invalid struct literal
...
If one tries to use promoted fields in a struct literal, the compiler
errors correctly. However, if the embedded fields are of struct pointer
type, the field.Type.Sym.Name expression below panics.
This is because field.Type.Sym is nil in that case. We can simply use
field.Sym.Name in this piece of code though, as it only concerns
embedded fields, in which case what we are after is the field name.
Added a test mirroring fixedbugs/issue23609.go, but with pointer types.
Fixes #26416 .
Change-Id: Ia46ce62995c9e1653f315accb99d592aff2f285e
Reviewed-on: https://go-review.googlesource.com/124395
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2018-07-18 20:32:04 +00:00
..
2017-01-20 05:55:53 +00:00
2017-03-22 03:23:16 +00:00
2017-09-15 02:39:16 +00:00
2018-06-06 20:35:23 +00:00
2018-07-10 15:41:15 +00:00
2016-05-02 13:43:18 +00:00
2018-07-18 20:32:04 +00:00
2016-05-02 13:43:18 +00:00
2015-10-07 14:37:44 +00:00
2017-04-24 12:37:49 +00:00
2017-03-16 02:44:16 +00:00
2018-05-31 17:36:45 +00:00
2017-02-08 20:59:45 +00:00
2018-03-01 21:11:16 +00:00
2016-05-02 13:43:18 +00:00
2018-04-03 05:34:20 +00:00
2016-07-06 20:48:41 +00:00
2016-04-24 21:36:52 +00:00
2016-05-02 13:43:18 +00:00
2018-04-05 22:01:17 +00:00
2017-01-20 05:55:53 +00:00
2016-05-02 13:43:18 +00:00
2018-04-09 18:57:37 +00:00
2018-05-06 04:28:23 +00:00
2018-05-06 04:28:23 +00:00
2017-05-11 13:53:54 +00:00
2016-03-17 04:20:02 +00:00
2015-12-02 18:26:38 +00:00
2016-05-02 13:43:18 +00:00
2018-05-29 02:39:16 +00:00
2018-02-15 21:12:23 +00:00
2017-05-18 00:05:25 +00:00
2017-11-03 20:09:26 +00:00
2015-06-26 03:38:21 +00:00
2017-04-24 12:37:49 +00:00
2017-03-15 22:45:17 +00:00
2017-03-15 22:45:17 +00:00
2017-03-15 22:45:17 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2018-04-09 23:19:45 +00:00
2015-07-11 14:36:33 +00:00
2015-07-11 14:36:33 +00:00
2016-05-02 13:43:18 +00:00
2016-09-17 01:12:24 +00:00
2016-05-02 13:43:18 +00:00
2016-10-04 17:10:47 +00:00
2015-05-07 23:54:28 +00:00
2017-04-24 12:37:49 +00:00
2017-08-11 17:41:17 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-05-31 17:36:45 +00:00
2017-03-14 18:49:23 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-12-13 21:32:01 +00:00
2017-08-11 00:56:21 +00:00
2017-08-11 00:56:21 +00:00
2016-05-02 13:43:18 +00:00
2018-06-06 20:35:23 +00:00
2018-04-18 02:59:37 +00:00
2018-03-28 16:56:03 +00:00
2018-03-29 14:17:40 +00:00
2016-05-02 13:43:18 +00:00
2017-02-15 01:33:03 +00:00
2016-05-02 13:43:18 +00:00
2016-10-10 12:09:16 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2015-11-03 18:57:18 +00:00
2016-09-14 16:39:47 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-04-30 19:39:18 +00:00
2018-05-08 21:15:48 +00:00
2016-05-02 13:43:18 +00:00
2018-05-31 17:36:45 +00:00
2017-04-19 02:27:58 +00:00
2015-11-12 18:32:13 +00:00
2018-05-31 17:36:45 +00:00
2016-05-02 13:43:18 +00:00
2017-03-24 20:07:15 +00:00
2017-02-10 01:22:30 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-03-06 23:48:37 +00:00
2017-04-24 12:37:49 +00:00
2015-09-05 02:25:01 +00:00
2017-04-18 19:56:30 +00:00
2017-11-22 00:52:54 +00:00
2017-03-03 21:29:32 +00:00
2018-03-13 20:34:03 +00:00
2017-11-05 04:18:05 +00:00
2017-10-10 19:43:38 +00:00
2016-09-19 19:03:01 +00:00
2017-04-12 14:27:45 +00:00
2016-05-02 13:43:18 +00:00
2018-04-30 19:39:18 +00:00
2016-05-02 13:43:18 +00:00
2017-02-08 20:59:45 +00:00
2018-04-30 19:39:18 +00:00
2018-04-30 19:39:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-11-02 17:03:45 +00:00
2018-04-30 19:39:18 +00:00
2018-05-22 14:43:37 +00:00
2018-04-05 10:53:40 +00:00
2018-07-09 18:23:39 +00:00
2017-08-15 05:54:24 +00:00
2018-03-14 08:36:15 +00:00
2017-04-24 12:37:49 +00:00
2017-04-24 12:37:49 +00:00
2018-05-08 21:15:16 +00:00
2017-09-03 14:29:38 +00:00
2016-03-17 00:38:15 +00:00
2017-10-12 20:50:20 +00:00
2016-05-02 13:43:18 +00:00
2017-10-12 20:50:20 +00:00
2018-04-06 15:39:11 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-04-30 19:39:18 +00:00
2018-04-30 19:39:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-04-30 19:39:18 +00:00
2016-10-15 17:58:14 +00:00
2017-11-06 21:07:57 +00:00
2017-02-01 22:52:32 +00:00
2017-10-29 19:36:44 +00:00
2016-10-25 22:28:40 +00:00
2017-01-09 21:01:29 +00:00
2018-04-30 19:39:18 +00:00
2016-09-13 20:06:13 +00:00
2018-05-31 17:36:45 +00:00
2017-09-26 04:08:38 +00:00
2018-05-31 17:36:45 +00:00
2018-07-09 18:23:39 +00:00
2017-09-12 05:50:54 +00:00
2018-03-03 19:52:00 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-01-10 01:35:45 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 22:07:02 +00:00
2017-08-22 13:44:35 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-02-11 21:46:21 +00:00
2018-03-01 21:11:16 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-06-06 15:12:32 +00:00
2016-05-02 13:43:18 +00:00
2017-03-01 01:06:32 +00:00
2017-12-01 20:39:50 +00:00
2016-05-02 13:43:18 +00:00
2018-05-31 17:36:45 +00:00
2018-04-30 19:39:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2018-03-08 22:25:25 +00:00
2018-06-12 19:10:34 +00:00
2016-03-30 22:27:13 +00:00
2016-05-02 13:43:18 +00:00
2016-08-19 01:10:21 +00:00
2017-05-19 18:11:51 +00:00
2017-02-02 17:36:43 +00:00
2017-05-19 18:11:51 +00:00
2015-11-03 18:57:18 +00:00
2015-09-06 23:50:51 +00:00
2017-02-10 01:22:30 +00:00
2017-03-25 22:52:54 +00:00
2018-02-14 21:41:39 +00:00
2016-07-06 20:48:41 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-05-11 18:28:40 +00:00
2016-12-23 17:35:24 +00:00