Yuxuan Chen
8db94f8248
[clang][Modules] Keep existing global definition on type mismatch in GetOrCreateLLVMGlobal ( #223877 )
...
When a global is requested for definition but a definition with the same
mangled name already exists, return it as is instead of creating a fresh
global and erasing the defined one, even if its type differs from the
requested type.
The type can legitimately differ when the initializer folded to a
different (e.g. anonymous) type, as happens with unions. Erasing the
defined global dangles pointers held by callers, e.g. the
`AssociatedData` of entries in `llvm.global_ctors`, leading to a
use-after-free crash during `EmitCtorList`. This also keeps the
deferred-decls "already emitted" check sound, since it queries with
`IsForDefinition`, which must be non-destructive.
Add a header-unit regression test: an inline variable with an
anonymous-union member, constant-initialized but requiring dynamic
destructor registration, must be emitted exactly once when imported from
header units. The folded initializer has an anonymous type that differs
from the declared type; a second emission used to replace (and erase)
the already-defined global, leaving a dangling pointer in
`llvm.global_ctors` (use-after-free, observable as a crash under ASan).
Assisted-By: Meta Muse 1.3
Co-authored-by: Michael Park <mcypark@gmail.com >
(cherry picked from commit 2a6fdac960de3a6bae854474f12e8f1edfcd9a04)
2026-11-02 10:44:26 +00:00
..
2026-04-23 15:40:33 -05:00
2026-03-13 15:48:37 -05:00
2026-06-03 10:41:23 -04:00
2026-03-04 16:13:48 -06:00
2026-06-11 11:25:46 -05:00
2026-03-04 16:13:48 -06:00
2026-03-13 09:29:28 +00:00
2026-06-03 10:41:23 -04:00
2026-06-05 15:31:30 +02:00
2026-05-07 13:16:14 -04:00
2026-03-06 08:33:34 +00:00
2026-05-07 13:16:14 -04:00
2026-03-06 08:33:34 +00:00
2026-06-30 08:39:54 +00:00
2026-06-30 08:39:54 +00:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-04-14 12:32:17 +00:00
2026-01-30 11:43:10 -08:00
2026-06-15 12:05:45 -07:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-09 10:42:59 +05:30
2026-06-09 10:42:59 +05:30
2026-06-09 10:42:59 +05:30
2026-03-13 15:48:37 -05:00
2026-05-07 13:16:14 -04:00
2026-05-11 06:18:44 -07:00
2026-03-13 15:48:37 -05:00
2026-06-11 11:25:46 -05:00
2026-05-07 13:16:14 -04:00
2026-03-20 13:08:23 -05:00
2026-06-22 17:40:45 +02:00
2026-04-07 13:53:58 -07:00
2026-05-11 06:18:44 -07:00
2026-05-11 06:18:44 -07:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-07-10 15:32:16 +00:00
2026-04-27 17:07:20 -04:00
2026-07-02 09:35:24 -07:00
2026-02-08 05:00:29 +00:00
2026-03-06 08:33:34 +00:00
2026-04-02 13:24:00 -04:00
2026-03-06 08:33:34 +00:00
2026-04-02 13:24:00 -04:00
2026-03-03 20:55:17 +05:30
2026-06-11 14:30:47 +00:00
2026-06-11 14:30:47 +00:00
2026-03-30 16:34:37 -07:00
2026-05-07 13:16:14 -04:00
2026-02-19 09:23:32 +00:00
2026-03-13 15:48:37 -05:00
2026-11-02 10:44:26 +00:00
2026-06-09 16:23:36 -04:00
2026-06-09 16:23:36 -04:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-02-25 06:56:00 -05:00
2026-04-14 12:32:17 +00:00
2026-03-04 16:13:48 -06:00
2026-03-04 16:13:48 -06:00
2026-03-04 16:13:48 -06:00
2026-03-04 16:13:48 -06:00
2026-03-04 16:13:48 -06:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-14 12:32:17 +00:00
2026-04-27 17:07:20 -04:00
2026-03-18 05:02:10 -07:00
2026-06-22 17:40:45 +02:00
2026-02-08 05:00:29 +00:00
2026-02-19 09:23:32 +00:00
2026-04-27 17:07:20 -04:00
2026-02-08 05:00:29 +00:00
2026-02-19 09:23:32 +00:00
2026-04-16 22:10:15 +02:00
2026-01-08 10:43:25 -05:00
2026-04-14 12:32:17 +00:00
2026-02-25 13:39:45 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-04-27 17:07:20 -04:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-30 08:39:54 +00:00
2026-03-13 15:48:37 -05:00
2026-06-05 22:34:02 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-04-27 17:07:20 -04:00
2026-04-27 17:07:20 -04:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 23:15:17 -04:00
2026-03-04 16:13:48 -06:00
2026-03-20 13:08:23 -05:00
2026-03-13 15:48:37 -05:00
2026-02-25 06:56:00 -05:00
2026-03-06 08:33:34 +00:00
2026-07-02 09:35:24 -07:00
2026-03-03 20:55:17 +05:30
2026-03-06 08:33:34 +00:00
2026-02-19 09:23:32 +00:00
2026-04-27 17:07:20 -04:00
2026-06-30 08:39:54 +00:00
2026-02-08 05:00:29 +00:00
2026-02-19 09:23:32 +00:00
2026-04-27 17:07:20 -04:00
2026-03-06 08:33:34 +00:00
2026-03-06 08:33:34 +00:00
2026-02-19 09:23:32 +00:00
2026-04-27 17:07:20 -04:00
2026-03-06 08:33:34 +00:00
2026-03-06 08:33:34 +00:00
2026-02-19 09:23:32 +00:00
2026-03-06 08:33:34 +00:00
2026-05-07 13:16:14 -04:00
2026-02-19 09:23:32 +00:00
2026-02-19 09:23:32 +00:00
2026-06-22 17:40:45 +02:00
2026-04-11 15:17:42 +02:00
2026-03-13 15:48:37 -05:00
2026-07-02 09:35:24 -07:00
2026-02-08 05:00:29 +00:00
2026-03-06 08:33:34 +00:00
2026-05-07 13:16:14 -04:00
2026-02-19 09:23:32 +00:00
2026-02-08 05:00:29 +00:00
2026-03-06 08:33:34 +00:00
2026-07-02 09:35:24 -07:00
2026-03-06 08:33:34 +00:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 23:29:24 -05:00
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-13 12:39:40 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-04-10 11:43:12 +05:30
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-11 11:25:46 -05:00
2026-03-06 08:33:34 +00:00
2026-04-28 14:28:37 +05:30
2026-04-27 17:07:20 -04:00
2026-03-13 15:48:37 -05:00
2026-02-19 09:23:32 +00:00
2026-01-16 10:58:19 -08:00
2026-01-23 12:36:54 -08:00
2026-01-16 10:58:19 -08:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-11 11:25:46 -05:00
2026-03-13 15:48:37 -05:00
2026-04-28 14:28:37 +05:30
2026-04-28 14:28:37 +05:30
2026-06-24 23:15:46 +02:00
2026-03-06 08:33:34 +00:00
2026-04-27 17:07:20 -04:00
2026-04-28 14:28:37 +05:30
2026-03-06 08:33:34 +00:00
2026-04-27 17:07:20 -04:00
2026-04-28 14:28:37 +05:30
2026-06-24 23:15:46 +02:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-11 11:25:46 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-02-19 09:23:32 +00:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-04-27 17:07:20 -04:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-04-27 17:07:20 -04:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-04-27 17:07:20 -04:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-06-24 23:15:46 +02:00
2026-06-24 23:15:46 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-03-13 15:48:37 -05:00
2026-06-11 11:25:46 -05:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-28 13:23:01 -07:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-28 13:23:01 -07:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-28 13:23:01 -07:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-07-10 08:42:30 +00:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-11 11:25:46 -05:00
2026-04-28 14:28:37 +05:30
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-06-03 10:41:23 -04:00
2026-06-03 10:41:23 -04:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-24 23:15:46 +02:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-03-26 15:55:31 +01:00
2026-03-26 15:55:31 +01:00
2026-04-27 17:07:20 -04:00
2026-04-28 14:28:37 +05:30
2026-03-25 15:44:48 +00:00
2026-03-13 15:48:37 -05:00
2026-03-13 15:48:37 -05:00
2026-01-05 13:25:03 -05:00
2026-06-05 22:34:02 +02:00
2026-01-05 13:25:03 -05:00
2026-01-05 13:25:03 -05:00
2026-01-05 13:25:03 -05:00
2026-01-05 13:25:03 -05:00
2026-03-03 13:20:24 -06:00
2026-02-03 08:14:31 -05:00
2026-03-02 14:34:40 +00:00
2026-02-08 05:00:29 +00:00
2026-03-13 15:48:37 -05:00
2026-03-12 05:07:40 -07:00
2026-03-12 05:07:40 -07:00
2026-02-25 06:56:00 -05:00
2026-02-03 08:14:31 -05:00
2026-03-12 05:07:40 -07:00
2026-02-08 05:00:29 +00:00
2026-02-19 09:23:32 +00:00
2026-04-27 17:07:20 -04:00
2026-02-08 05:00:29 +00:00
2026-02-19 09:23:32 +00:00
2026-06-30 08:39:54 +00:00
2026-06-24 23:15:46 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-03-13 15:48:37 -05:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-07-10 08:42:30 +00:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-07-02 09:35:24 -07:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-22 17:40:45 +02:00
2026-06-28 13:23:01 -07:00
2026-06-22 17:40:45 +02:00
2026-05-20 12:27:07 -07:00
2026-05-20 12:27:07 -07:00
2026-03-06 08:33:34 +00:00
2026-03-04 16:13:48 -06:00
2026-07-09 10:51:35 -05:00