bors
591ecb88df
Auto merge of #128742 - RalfJung:miri-vtable-uniqueness, r=saethlin
...
miri: make vtable addresses not globally unique
Miri currently gives vtables a unique global address. That's not actually matching reality though. So this PR enables Miri to generate different addresses for the same type-trait pair.
To avoid generating an unbounded number of `AllocId` (and consuming unbounded amounts of memory), we use the "salt" technique that we also already use for giving constants non-unique addresses: the cache is keyed on a "salt" value n top of the actually relevant key, and Miri picks a random salt (currently in the range `0..16`) each time it needs to choose an `AllocId` for one of these globals -- that means we'll get up to 16 different addresses for each vtable. The salt scheme is integrated into the global allocation deduplication logic in `tcx`, and also used for functions and string literals. (So this also fixes the problem that casting the same function to a fn ptr over and over will consume unbounded memory.)
r? `@saethlin`
Fixes https://github.com/rust-lang/miri/issues/3737
2024-08-13 04:32:34 +00:00
..
2024-07-11 12:23:44 +10:00
2024-02-25 08:15:44 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-19 22:11:13 +00:00
2024-02-16 20:02:50 +00:00
2024-05-01 16:54:20 -07:00
2024-05-01 16:54:20 -07:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-27 21:12:54 +02:00
2024-02-16 20:02:50 +00:00
2024-06-12 12:34:47 +00:00
2024-06-12 12:34:47 +00:00
2024-07-11 12:23:44 +10:00
2024-04-09 13:58:52 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-03 19:41:18 +01:00
2024-02-03 19:41:18 +01:00
2024-05-24 21:09:15 -04:00
2024-05-24 21:09:15 -04:00
2024-02-19 22:11:13 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-27 11:02:15 +05:30
2024-04-27 11:02:15 +05:30
2024-04-16 12:42:48 +05:30
2024-04-16 12:42:48 +05:30
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-14 21:55:07 +01:00
2024-03-08 19:00:53 +08:00
2024-03-08 19:00:53 +08:00
2024-03-08 19:00:53 +08:00
2024-02-16 20:02:50 +00:00
2024-02-17 10:44:46 +05:30
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-14 21:55:07 +01:00
2024-03-14 21:55:07 +01:00
2024-02-16 20:02:50 +00:00
2024-02-17 10:44:46 +05:30
2024-03-14 21:55:07 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-13 12:46:58 -05:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-14 21:55:07 +01:00
2024-06-22 17:39:01 +02:00
2024-02-16 20:02:50 +00:00
2024-07-12 03:02:57 +00:00
2024-02-16 20:02:50 +00:00
2024-01-13 12:46:58 -05:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-27 21:12:54 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-04 21:27:51 +02:00
2024-07-04 21:27:51 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-08-09 18:48:45 +02:00
2024-08-09 18:48:45 +02:00
2024-08-09 18:48:45 +02:00
2024-07-27 21:12:54 +02:00
2024-08-01 14:25:19 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-11 12:23:44 +10:00
2024-08-09 18:48:45 +02:00
2024-08-09 18:48:45 +02:00
2024-08-09 18:48:45 +02:00
2024-06-11 13:28:36 +02:00
2024-06-11 13:28:36 +02:00
2024-07-11 12:23:44 +10:00
2024-08-01 14:25:19 +02:00
2024-07-11 12:23:44 +10:00
2024-02-16 20:02:50 +00:00
2024-07-11 12:23:44 +10:00
2024-02-16 20:02:50 +00:00
2024-08-09 18:48:45 +02:00
2024-08-09 18:48:45 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-19 13:54:55 +01:00
2024-04-22 18:48:47 +02:00
2024-02-19 22:11:13 +00:00
2024-02-19 22:11:13 +00:00
2024-06-22 17:39:01 +02:00
2024-06-22 17:39:01 +02:00
2024-08-10 12:07:17 +02:00
2024-02-16 20:02:50 +00:00