Module: wine Branch: master Commit: 9d26c6d75a7c2c43723b7dbc8872273c90de62ba URL: https://gitlab.winehq.org/wine/wine/-/commit/9d26c6d75a7c2c43723b7dbc8872273...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Jan 7 19:12:47 2016 +0800
widl: Properly align name table entries.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
---
tools/widl/write_sltg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c index c924eff89ed..1ab853fb945 100644 --- a/tools/widl/write_sltg.c +++ b/tools/widl/write_sltg.c @@ -192,10 +192,15 @@ static int add_name(struct sltg_data *name_table, const char *name) { int name_offset = name_table->size; int new_size = name_table->size + strlen(name) + 1 + 8; + int aligned_size;
chat("add_name: %s\n", name);
- new_size = (new_size + 1) & ~1; /* align */ + aligned_size = (new_size + 0x1f) & ~0x1f; + if (aligned_size - new_size < 4) + new_size = aligned_size; + else + new_size = (new_size + 1) & ~1;
if (new_size > name_table->allocated) {