Fatih BAKIR
c703f5a163
[lld][Webassembly] Avoid a signed overflow on large sections ( #178287 )
...
wasm sections sizes are specified as u32s, and thus can be as large as
4GB. wasm-ld currently stores the offset into a section as an int32_t
which overflows on large sections and results in a crash. This change
makes it a int64_t to accommodate any valid wasm section and allow
catching even larger sections instead of wrapping around.
This PR fixes the issue by storing the offset as a int64_t, as well as
adding extra checks to handle un-encodeable sections to fail instead of
producing garbage wasm binaries, and also adds lit tests to make sure it
works. I confirmed the test fails on `main` but passes with this fix.
Fixes : #178286
2026-02-10 12:04:05 -08:00
..
2026-02-06 13:09:02 -08:00
2025-12-23 16:58:06 -08:00
2025-11-08 00:27:06 +00:00
2024-09-04 08:50:10 -07:00
2025-09-29 15:45:48 -07:00
2024-08-19 21:51:40 -07:00
2025-10-06 16:30:40 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-02-10 10:57:45 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-10-15 02:41:43 +09:00
2025-11-08 00:27:06 +00:00
2026-02-09 14:29:42 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-10-22 19:14:37 +08:00
2026-01-16 13:12:49 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-07-16 13:14:30 -07:00
2025-11-08 00:27:06 +00:00
2026-02-09 14:29:42 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-02-06 13:09:02 -08:00
2025-11-08 00:27:06 +00:00
2024-12-02 17:08:07 -08:00
2025-11-08 00:27:06 +00:00
2025-03-04 09:39:30 -08:00
2024-12-02 17:08:07 -08:00
2026-02-10 12:04:05 -08:00
2025-11-08 00:27:06 +00:00
2026-02-10 12:04:05 -08:00
2025-08-27 01:16:53 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-01-29 09:27:22 -08:00
2025-11-08 00:27:06 +00:00
2026-02-09 14:29:42 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-01-29 16:47:03 -08:00
2026-01-29 16:47:03 -08:00
2025-08-19 09:46:10 -07:00
2025-11-08 00:27:06 +00:00
2022-11-27 20:06:48 -08:00
2025-09-03 09:12:12 -07:00
2025-02-28 11:12:52 -08:00
2025-11-03 14:42:05 -08:00
2026-02-10 12:04:05 -08:00
2025-01-28 16:06:01 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-09-30 17:17:58 -07:00
2025-02-10 10:35:44 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-09-11 11:22:46 -07:00
2025-11-08 00:27:06 +00:00
2025-09-19 10:11:15 -07:00
2024-11-04 16:12:57 -08:00
2025-11-08 00:27:06 +00:00
2024-09-30 17:17:58 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-09-30 17:17:58 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-09-24 11:14:07 -07:00
2024-09-24 11:14:07 -07:00
2024-10-22 10:47:57 -07:00
2025-09-29 15:45:48 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-27 19:21:09 +00:00
2022-07-29 13:52:52 -07:00