From 1502c6d660ac78f68c047b9ee57ec3dc98d93789 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sat, 7 Sep 2024 23:38:20 +0200 Subject: [PATCH] Limit object filename lengths. #1415 --- releasenotes.md | 1 + src/compiler/module.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/releasenotes.md b/releasenotes.md index 3b20420fd..4053055b5 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -16,6 +16,7 @@ - "optsize" did not work correctly in project.json. - `l[0].a = 1` now supported for overloads due to better lvalue handling #1357. - Asserts are retained regardless of optimization when running tests. +- Limit object filename lengths. #1415 ### Stdlib changes - Additional init functions for hashmap. diff --git a/src/compiler/module.c b/src/compiler/module.c index 70a900e86..afbef7992 100644 --- a/src/compiler/module.c +++ b/src/compiler/module.c @@ -64,6 +64,11 @@ const char *module_create_object_file_name(Module *module) break; } } + if (scratch_buffer.len > 128) + { + scratch_buffer.len = 128; + scratch_buffer_printf("@%X", module); + } return scratch_buffer_to_string(); }