QuietMisdreavus
3386156b1e
[clang][ExtractAPI] fix a couple crashes when used via libclang ( #132297 )
...
This PR fixes two crashes in ExtractAPI that occur when decls are
requested via libclang:
- A null-dereference would sometimes happen in
`DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization`
when the template being processed was loaded indirectly via a typedef,
with parameters filled in. The first commit loads the template parameter
locations ahead of time to perform a null check before dereferencing.
- An assertion (or another null-dereference) was happening in
`CXXRecordDecl::bases` when processing a forward-declaration (i.e. a
record without a definition). The second commit guards the use of
`bases` in `ExtractAPIVisitorBase::getBases` by first checking that the
decl in question has a complete definition.
The added test `extract-api-cursor-cpp` adds tests for these two
scenarios to protect against the crash in the future.
Fixes rdar://140592475, fixes rdar://123430367
2025-03-26 17:46:21 -06:00
..
2025-02-18 01:13:35 -05:00
2023-12-14 14:03:57 -08:00
2023-09-08 16:38:08 -07:00
2024-07-08 14:52:40 -04:00
2023-03-01 05:58:34 -05:00
2023-08-28 12:13:42 -04:00
2023-10-26 17:32:36 +01:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2024-07-02 14:45:52 -04:00
2022-07-27 11:10:54 +02:00
2023-08-28 12:13:42 -04:00
2024-04-30 14:25:09 -04:00
2022-08-04 12:14:43 +02:00
2023-08-28 12:13:42 -04:00
2022-11-14 12:27:11 +04:00
2024-01-20 12:37:35 -05:00
2022-09-21 11:12:48 -04:00
2022-07-19 09:17:39 -07:00
2024-07-15 09:17:28 -04:00
2024-07-15 09:17:28 -04:00
2024-07-15 09:17:28 -04:00
2024-06-16 12:25:25 +02:00
2023-08-28 12:13:42 -04:00
2023-09-25 09:56:28 -07:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-11-14 12:27:11 +04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-09-02 12:34:38 +01:00
2024-06-20 12:14:51 -04:00
2023-08-28 12:13:42 -04:00
2025-02-20 09:41:00 -08:00
2023-08-28 12:13:42 -04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-04-06 19:02:41 +02:00
2023-08-28 12:13:42 -04:00
2024-08-28 16:53:40 -03:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-11-14 12:27:11 +04:00
2023-08-28 12:13:42 -04:00
2023-08-16 10:22:16 +02:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-11-14 12:27:11 +04:00
2022-10-27 06:55:11 +02:00
2023-02-23 14:40:58 +08:00
2023-03-10 00:51:55 +00:00
2025-01-22 16:52:09 -08:00
2023-03-10 00:51:55 +00:00
2023-03-10 00:51:55 +00:00
2023-03-10 00:51:55 +00:00
2023-03-10 00:51:55 +00:00
2023-08-28 12:13:42 -04:00
2022-08-04 12:14:43 +02:00
2022-09-21 11:12:48 -04:00
2023-03-10 00:51:55 +00:00
2023-01-27 13:23:41 +01:00
2023-01-27 13:23:41 +01:00
2025-03-26 17:46:21 -06:00
2024-04-03 10:18:05 +01:00
2023-03-30 18:13:58 +01:00
2023-08-28 12:13:42 -04:00
2023-01-20 21:28:59 +00:00
2023-01-20 21:28:59 +00:00
2023-01-20 21:28:59 +00:00
2023-01-27 13:23:41 +01:00
2023-08-28 12:13:42 -04:00
2022-11-28 11:51:08 -08:00
2022-11-28 11:51:08 -08:00
2022-11-28 11:51:08 -08:00
2022-11-28 11:51:08 -08:00
2022-11-28 11:51:08 -08:00
2022-05-30 09:35:26 -04:00
2024-07-15 09:17:28 -04:00
2023-08-28 12:13:42 -04:00
2025-02-07 12:02:13 -08:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-11-28 11:51:08 -08:00
2024-05-14 16:09:57 -04:00
2022-09-23 11:06:14 -04:00
2023-12-01 00:32:26 +00:00
2022-07-27 11:10:54 +02:00
2024-07-15 09:17:28 -04:00
2022-07-27 11:10:54 +02:00
2023-08-28 12:13:42 -04:00
2022-11-14 15:21:36 +01:00
2024-01-22 14:53:35 -05:00
2024-07-15 09:17:28 -04:00
2022-07-27 11:10:54 +02:00
2025-02-13 07:14:36 -05:00
2023-06-15 12:41:09 +05:30
2024-06-22 21:16:51 +03:00
2023-08-28 12:13:42 -04:00
2022-07-27 11:10:54 +02:00
2025-03-18 09:11:43 +00:00
2024-07-31 10:38:32 -07:00
2022-04-25 17:26:39 +02:00
2024-10-22 12:05:48 +01:00
2024-07-15 09:17:28 -04:00
2022-09-23 11:06:14 -04:00
2022-07-27 11:10:54 +02:00
2024-07-15 09:17:28 -04:00
2025-03-21 13:20:52 -03:00
2023-08-28 12:13:42 -04:00
2023-03-23 08:05:58 -04:00
2023-03-23 08:05:58 -04:00
2024-07-15 09:17:28 -04:00
2024-07-15 09:17:28 -04:00
2022-05-04 08:35:47 -04:00
2023-08-28 12:13:42 -04:00
2022-10-14 08:18:28 -04:00
2022-10-14 08:18:28 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2024-06-16 12:25:25 +02:00
2024-01-22 14:53:35 -05:00
2024-07-15 09:17:28 -04:00