Nicholas Bishop
afd679129d
Fix crash from accessing a Check::Context during lowering ( #7335 )
...
In generate_ast.cpp, an `CarbonExternalASTSource` is installed that has
a `Check::Context` pointer. During lowering, this `ExternalASTSource` is
still installed, and using it can cause a crash if the now-invalid
pointer is dereferenced.
Fix by adding a new `ReadOnlyASTSource` in sem_ir, and using that during
lowering.
`CarbonExternalASTSource` now inherits from `ReadOnlyASTSource` to avoid
some code duplication.
In generate_ast.cpp, we now always install a multiplex source, even if
there's only one child source. Clang internally keeps pointers to the
top-level `ExternalASTSource` installed via `setExternalSource`, and
those pointers aren't updated if `setExternalSource` is called again. By
using `MultiplexExternalSemaSource`, we can keep the top-level
`ExternalASTSource` pointer the same, and only update its children.
Using `MultiplexExternalSemaSource` this way requires a new constructor
and a method to modify its child sources; added a new LLVM patch adding
those.
https://github.com/carbon-language/carbon-lang/issues/7142
2026-06-12 18:05:19 +00:00
..
2026-06-12 18:05:19 +00:00
2025-02-20 22:42:47 +00:00
2026-06-11 21:49:20 +00:00
2026-05-07 19:42:23 +00:00
2026-04-29 18:13:42 +00:00
2026-06-12 18:05:19 +00:00
2026-06-10 15:30:43 +00:00
2026-04-29 18:33:53 +00:00
2025-01-27 23:48:44 +00:00
2026-05-21 00:02:29 +00:00
2026-05-19 23:16:51 +00:00
2026-05-19 23:16:51 +00:00
2026-05-19 23:16:51 +00:00
2026-06-01 19:02:01 +00:00
2026-05-18 20:09:17 +00:00
2026-05-19 23:16:51 +00:00
2026-06-05 02:07:46 +00:00
2026-03-27 21:41:04 +00:00
2025-07-10 16:32:39 +00:00
2026-06-10 15:30:43 +00:00
2026-06-10 15:30:43 +00:00
2025-12-11 21:41:47 +00:00
2026-06-04 00:33:33 +00:00
2025-12-11 21:41:47 +00:00
2026-06-10 00:48:33 +00:00
2026-05-29 22:42:12 +00:00
2026-05-18 20:09:17 +00:00
2026-05-19 18:01:54 +00:00
2026-02-19 23:33:36 +00:00
2026-06-11 19:20:22 +00:00
2026-02-19 16:24:07 +00:00
2025-06-10 22:09:31 +00:00
2026-06-09 21:10:18 +00:00
2026-04-23 20:11:04 +00:00
2026-02-04 17:24:55 +00:00
2026-02-25 15:15:29 +00:00
2026-06-09 22:17:18 +00:00
2026-05-19 18:01:54 +00:00
2026-04-29 18:13:42 +00:00
2026-06-11 16:45:39 +00:00
2026-03-27 19:36:52 +00:00
2026-05-27 15:43:41 +00:00
2026-05-01 21:22:32 +00:00
2026-05-18 20:09:17 +00:00
2026-06-10 15:30:43 +00:00
2026-06-10 15:30:43 +00:00
2026-02-19 16:24:07 +00:00
2026-02-19 16:24:07 +00:00
2026-03-27 19:36:52 +00:00
2026-02-19 16:24:07 +00:00
2026-05-18 20:09:17 +00:00
2026-05-18 20:09:17 +00:00
2026-06-05 22:33:30 +00:00
2025-04-28 19:06:24 +00:00
2026-06-10 15:30:43 +00:00
2025-12-30 19:18:34 +00:00
2026-02-19 23:33:36 +00:00
2026-05-01 22:45:22 +00:00
2026-02-19 23:33:36 +00:00
2025-04-28 19:06:24 +00:00
2025-05-09 16:35:28 +00:00
2024-07-12 22:38:06 +00:00
2026-03-06 17:35:48 +00:00
2026-06-10 15:30:43 +00:00
2026-05-01 18:46:52 +00:00
2025-02-14 19:44:36 +00:00
2026-05-19 18:01:54 +00:00
2026-03-31 22:27:43 +00:00
2026-02-09 22:00:21 +00:00
2026-05-21 21:21:50 +00:00
2026-05-19 18:01:54 +00:00
2026-01-14 16:58:15 +00:00
2026-05-22 02:48:07 +00:00
2026-06-11 16:45:39 +00:00
2026-04-29 00:28:00 +00:00
2026-03-10 20:04:28 +00:00
2026-05-18 20:09:17 +00:00
2026-03-09 22:30:16 +00:00
2026-03-26 15:26:56 +00:00
2026-05-21 00:02:29 +00:00
2024-12-18 00:19:12 +00:00
2026-02-26 19:21:19 +00:00
2026-04-28 20:10:13 +00:00
2024-07-12 22:38:06 +00:00
2026-05-18 20:09:17 +00:00
2026-05-13 16:11:20 +00:00
2024-07-12 22:38:06 +00:00
2026-05-02 01:09:50 +00:00
2026-02-09 22:00:21 +00:00
2026-06-04 20:47:07 +00:00
2025-06-10 22:09:31 +00:00
2026-05-25 23:02:06 +00:00
2026-04-24 19:08:11 +00:00
2026-05-06 14:17:54 +00:00
2025-05-22 18:58:47 +00:00
2026-05-13 17:40:45 +00:00
2026-05-13 16:11:20 +00:00
2026-06-04 23:16:11 +00:00
2025-09-10 21:40:27 +00:00
2026-05-21 00:02:29 +00:00
2026-03-24 20:56:44 +00:00
2025-03-21 23:09:37 +00:00
2025-11-11 16:36:15 +00:00
2026-04-29 18:13:42 +00:00
2026-04-16 23:31:31 +00:00
2026-02-19 23:33:36 +00:00
2026-02-19 16:24:07 +00:00
2025-09-12 22:59:37 +00:00
2026-05-18 20:09:17 +00:00
2026-02-19 23:33:36 +00:00
2026-06-05 22:33:30 +00:00
2026-02-26 20:10:50 +00:00
2026-06-10 15:30:43 +00:00
2026-02-25 15:15:29 +00:00
2026-06-10 15:30:43 +00:00
2026-06-09 21:10:18 +00:00
2026-05-19 18:01:54 +00:00
2026-02-19 16:24:07 +00:00
2026-04-22 23:38:21 +00:00
2026-04-22 23:38:21 +00:00
2026-06-05 23:30:09 +00:00
2026-05-13 17:16:02 +00:00
2025-06-10 20:54:58 +00:00
2025-06-10 20:54:58 +00:00
2025-12-09 20:38:50 +00:00
2025-12-09 20:38:50 +00:00
2025-06-10 22:09:31 +00:00
2025-06-10 22:09:31 +00:00
2026-01-14 19:32:03 +00:00
2026-05-13 21:22:46 +00:00
2026-06-11 21:49:20 +00:00
2026-02-25 15:15:29 +00:00
2025-02-25 02:07:43 +00:00
2026-06-10 15:30:43 +00:00
2026-06-10 15:30:43 +00:00
2026-06-01 21:55:16 +00:00
2026-06-01 21:55:16 +00:00
2026-05-04 21:50:13 +00:00
2026-05-13 18:24:31 +00:00
2026-05-13 18:24:31 +00:00
2025-05-01 22:17:55 +00:00
2025-05-01 22:17:55 +00:00
2026-03-28 00:06:06 +00:00
2026-03-26 15:26:56 +00:00
2026-03-26 15:26:56 +00:00
2026-06-04 15:51:28 +00:00
2026-02-19 23:33:36 +00:00
2025-11-14 13:50:56 +00:00
2026-06-02 16:27:21 +00:00
2026-05-07 13:44:40 +00:00
2026-05-27 15:43:41 +00:00
2025-10-28 17:17:38 +00:00
2026-06-10 15:30:43 +00:00
2026-06-09 21:10:18 +00:00
2026-05-13 18:49:02 +00:00
2026-03-26 15:26:56 +00:00
2026-05-11 14:17:18 +00:00
2026-05-07 22:33:47 +00:00
2026-06-01 21:55:16 +00:00
2026-06-01 21:55:16 +00:00
2026-02-26 18:57:15 +00:00
2026-02-19 23:33:36 +00:00