thepudds
988a20c8c5
cmd/compile/internal/escape: evaluate any side effects when rewriting with literals
...
CL 649035 and CL 649079 updated escape analysis to rewrite
certain operands in OMAKE and OCONVIFACE nodes from non-constant
expressions to basic literals that evaluate to the same value.
However, when doing that rewriting, we need to evaluate any
side effects prior to replacing the expression, which is what
this CL now does.
Issue #74379 reported a problem with OCONVIFACE nodes due to CL 649079.
CL 649035 has essentially the same issue with OMAKE nodes. To illustrate
that, we add a test for the OMAKE case in fixedbugs/issue74379b.go,
which fails without this change. To avoid introducing an unnecessary
temporary for OMAKE nodes, we also conditionalize the main work of
CL 649035 on whether the OMAKE operand is already an OLITERAL.
CL 649555 and CL 649078 were related changes that created read-only
global storage for composite literals used in an interface conversion.
This CL adds a test in fixedbugs/issue74379c.go to illustrate
that they do not have the same problem.
Updates #71359
Fixes #74379
Change-Id: I6645575ef34f1fe2b0241a22dc205875d66b7ada
Reviewed-on: https://go-review.googlesource.com/c/go/+/684116
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Keith Randall <khr@golang.org >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Keith Randall <khr@google.com >
2025-06-26 10:24:19 -07:00
..
2023-10-19 23:33:25 +00:00
2017-01-20 05:55:53 +00:00
2023-06-16 17:08:43 +00:00
2022-01-10 21:27:19 +00:00
2021-07-14 23:33:46 +00:00
2024-11-22 02:04:41 +00:00
2022-03-24 02:14:15 +00:00
2025-06-09 20:33:27 -07:00
2016-05-02 13:43:18 +00:00
2013-01-11 22:00:48 +01:00
2025-06-26 10:24:19 -07:00
2016-05-02 13:43:18 +00:00
2022-09-27 21:10:19 +00:00
2023-03-28 14:28:33 +00:00
2024-09-17 17:01:20 +00:00
2024-07-23 19:05:35 +00:00
2021-12-05 12:50:44 +00:00
2022-03-24 17:50:47 +00:00
2024-06-07 15:22:22 +00:00
2021-12-13 22:42:08 +00:00
2024-03-25 19:21:35 +00:00
2024-11-14 02:14:13 +00:00
2024-04-05 16:29:58 +00:00
2016-07-06 20:48:41 +00:00
2024-10-28 13:27:58 +00:00
2016-04-24 21:36:52 +00:00
2016-05-02 13:43:18 +00:00
2024-10-23 04:43:01 +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
2022-09-28 22:28:39 +00:00
2018-05-06 04:28:23 +00:00
2017-05-11 13:53:54 +00:00
2021-10-30 18:30:05 +00:00
2012-02-19 13:19:43 +11:00
2024-11-18 18:52:54 +00:00
2020-12-14 12:13:36 -08:00
2016-05-02 13:43:18 +00:00
2020-10-27 03:11:45 +00:00
2020-12-01 21:49:31 +00:00
2021-01-05 21:44:30 +00:00
2023-10-19 23:33:25 +00:00
2021-03-05 18:46:43 +00:00
2024-08-07 16:07:33 +00:00
2023-01-31 19:43:07 +00:00
2023-03-06 18:34:24 +00:00
2023-10-19 23:33:25 +00:00
2018-08-14 09:19:38 +00:00
2021-01-20 22:53:32 +00:00
2021-01-23 02:15:24 +00:00
2021-02-01 18:28:05 +00:00
2020-12-01 21:49:31 +00:00
2019-03-14 21:00:20 +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
2025-03-11 05:44:15 -07:00
2016-05-02 13:43:18 +00:00
2020-12-01 21:49:31 +00:00
2020-12-01 21:49:31 +00:00
2016-05-02 13:43:18 +00:00
2023-04-11 20:56:32 +00:00
2022-06-28 18:11:31 +00:00
2019-09-26 23:54:29 +00:00
2016-05-02 13:43:18 +00:00
2022-09-08 15:55:44 +00:00
2022-09-19 18:58:26 +00:00
2022-11-17 13:46:05 +00:00
2021-03-23 05:11:09 +00:00
2025-03-10 21:30:51 -07:00
2022-09-28 22:28:39 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2021-06-14 07:12:37 +00:00
2024-07-29 14:30:07 +00:00
2021-01-05 21:11:31 +00:00
2019-10-16 00:05:37 +00:00
2018-05-31 17:36:45 +00:00
2021-08-09 16:10:20 +00:00
2022-09-02 06:22:23 +00:00
2022-09-02 06:22:23 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2021-01-19 20:07:52 +00:00
2021-01-19 20:07:52 +00:00
2023-05-12 12:34:59 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2025-05-19 16:14:53 -07:00
2025-05-19 16:14:53 -07:00
2016-05-02 13:43:18 +00:00
2024-07-22 21:27:37 +00:00
2025-05-21 12:02:43 -07:00
2025-04-04 15:04:34 -07:00
2025-02-19 13:38:58 -08:00
2025-05-19 16:14:53 -07:00
2024-07-22 21:27:37 +00:00
2020-09-12 08:31:49 +00:00
2021-07-28 21:41:07 +00:00
2019-11-16 20:31:45 +00:00
2025-05-21 12:24:22 -07:00
2025-05-21 12:02:43 -07:00
2020-09-12 08:31:49 +00:00
2019-09-03 17:52:06 +00:00
2025-04-04 10:36:58 -07:00
2025-05-19 16:14:53 -07:00
2023-08-18 11:58:37 +00:00
2021-05-26 23:50:32 +00:00
2024-09-18 20:57:20 +00:00
2024-03-25 19:53:03 +00:00
2019-04-17 16:36:56 +00:00
2025-05-19 16:14:53 -07:00
2020-09-12 08:31:49 +00:00
2020-09-12 08:31:49 +00:00
2021-05-26 23:50:32 +00:00
2019-04-17 19:09:15 +00:00
2025-05-21 20:07:36 -07:00
2022-09-07 17:25:59 +00:00
2023-03-06 18:34:24 +00:00
2023-11-16 05:48:00 +00:00
2016-09-14 16:39:47 +00:00
2021-12-03 16:24:32 +00:00
2023-07-10 16:36:41 +00:00
2020-12-04 21:22:23 +00:00
2024-09-30 22:04:40 +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
2020-12-04 21:22:23 +00:00
2020-12-04 21:22:23 +00:00
2024-08-07 16:07:55 +00:00
2023-10-19 23:33:25 +00:00
2018-05-08 21:15:48 +00:00
2016-05-02 13:43:18 +00:00
2019-10-10 19:38:06 +00:00
2017-04-19 02:27:58 +00:00
2022-05-27 21:36:06 +00:00
2018-05-31 17:36:45 +00:00
2022-09-27 21:10:19 +00:00
2016-05-02 13:43:18 +00:00
2017-03-24 20:07:15 +00:00
2022-01-11 02:26:58 +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
2019-09-08 17:28:20 +00:00
2016-05-02 13:43:18 +00:00
2020-12-14 12:13:36 -08:00
2022-09-23 20:27:09 +00:00
2022-11-16 04:04:52 +00:00
2022-01-11 02:26:58 +00:00
2024-10-22 22:20:29 +00:00
2023-08-18 11:58:37 +00:00
2019-01-08 21:54:04 +00:00
2019-01-08 21:54:04 +00:00
2025-05-19 16:14:53 -07:00
2017-03-03 21:29:32 +00:00
2023-10-19 23:33:25 +00:00
2025-04-22 08:28:13 -07:00
2025-03-24 11:41:09 -07:00
2021-05-26 23:50:45 +00:00
2025-03-06 10:07:17 -08:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2020-11-28 02:31:54 +00:00
2020-11-28 02:31:54 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-05-15 19:27:25 +00:00
2019-08-28 19:27:20 +00:00
2024-06-07 15:22:22 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2019-11-01 20:13:05 +00:00
2019-02-19 22:45:09 +00:00
2016-05-02 13:43:18 +00:00
2024-10-21 14:16:20 +00:00
2025-05-21 12:23:26 -07:00
2023-10-19 23:33:25 +00:00
2025-05-21 12:23:26 -07:00
2025-03-06 10:07:17 -08:00
2020-12-17 04:43:46 +00:00
2024-04-04 14:29:45 +00:00
2021-04-23 00:41:01 +00:00
2020-12-04 21:22:23 +00:00
2020-05-07 17:50:24 +00:00
2020-12-14 12:13:36 -08:00
2018-05-08 21:15:16 +00:00
2023-10-19 23:33:25 +00:00
2021-11-05 00:52:06 +00:00
2017-09-03 14:29:38 +00:00
2022-09-27 21:59:19 +00:00
2022-01-10 22:48:40 +00:00
2016-05-02 13:43:18 +00:00
2020-12-04 21:22:23 +00:00
2021-01-26 17:05:06 +00:00
2020-12-04 21:22:23 +00:00
2016-05-02 13:43:18 +00:00
2025-03-06 10:07:17 -08:00
2022-06-30 18:41:59 +00:00
2019-05-11 03:02:33 +00:00
2023-10-19 23:33:25 +00:00
2016-05-02 13:43:18 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2025-05-12 11:05:28 -07:00
2023-04-14 17:57:36 +00:00
2024-12-06 00:35:41 +00:00
2023-08-22 19:18:21 +00:00
2016-10-25 22:28:40 +00:00
2023-10-19 23:33:25 +00:00
2018-04-30 19:39:18 +00:00
2025-05-08 10:18:37 -07: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
2024-08-07 16:07:33 +00:00
2023-10-19 23:33:25 +00:00
2025-03-11 20:17:36 -07:00
2025-03-11 19:51:59 -07:00
2023-11-08 15:32:14 +00:00
2023-12-01 17:20:08 +00:00
2024-01-08 16:00:53 +00:00
2017-09-12 05:50:54 +00:00
2023-12-18 23:35:19 +00:00
2023-05-12 17:18:08 +00:00
2016-05-02 13:43:18 +00:00
2019-09-03 20:41:29 +00:00
2016-05-02 13:43:18 +00:00
2023-10-19 23:33:25 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2020-04-19 03:12:32 +00:00
2020-04-19 03:12:32 +00:00
2021-10-26 14:24:17 +00:00
2021-07-22 17:48:41 +00:00
2023-04-19 14:07:00 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2021-01-16 23:19:26 +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
2016-05-02 13:43:18 +00:00
2020-12-09 23:56:19 +00:00
2021-12-03 16:24:32 +00:00
2016-05-02 13:43:18 +00:00
2022-04-07 17:19:55 +00:00
2023-10-19 23:33:25 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2020-12-14 21:28:48 +00:00
2016-05-02 13:43:18 +00:00
2018-03-08 22:25:25 +00:00
2018-10-03 19:54:29 +00:00
2018-10-03 19:54:16 +00:00
2018-10-03 19:54:16 +00:00
2018-06-12 19:10:34 +00:00
2019-09-08 17:28:20 +00:00
2016-05-02 13:43:18 +00:00
2024-11-14 02:14:13 +00:00
2020-12-15 19:43:32 +00:00
2020-12-14 21:28:48 +00:00
2022-09-24 17:04:15 +00:00
2020-12-14 21:28:48 +00:00
2022-07-19 23:30:49 +00:00
2025-06-04 08:27:44 -07:00
2025-02-13 14:07:47 -08:00
2022-01-11 02:26:58 +00:00
2022-09-23 20:27:09 +00:00
2019-09-11 23:33:11 +00:00
2022-09-27 21:10:19 +00:00
2021-11-12 22:20:51 +00:00
2021-06-24 18:24:24 +00:00
2019-11-05 00:26:30 +00:00
2016-07-06 20:48:41 +00:00
2022-04-21 18:06:38 +00:00
2016-05-02 13:43:18 +00:00
2022-08-31 17:15:15 +00:00
2022-08-31 17:15:15 +00:00
2022-08-31 17:15:15 +00:00
2022-08-31 17:15:15 +00:00
2020-12-28 00:39:17 -08:00
2020-12-04 21:22:23 +00:00
2024-11-11 17:11:50 +00:00
2024-08-09 20:07:54 +00:00
2024-10-28 13:27:58 +00:00
2025-02-06 13:16:59 -08:00
2020-12-02 16:33:57 +00:00
2021-08-23 19:46:36 +00:00
2021-10-06 15:53:04 +00:00
2023-04-28 18:35:43 +00:00