Eric Pouech : dbghelp: Create lexical relationship between global vars and symt_module.

Alexandre Julliard julliard at winehq.org
Tue Jul 12 16:45:37 CDT 2022


Module: wine
Branch: master
Commit: d2a5f434c4fd03c61e96b10f1c3c9def70dcc9ca
URL:    https://gitlab.winehq.org/wine/wine/-/commit/d2a5f434c4fd03c61e96b10f1c3c9def70dcc9ca

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Tue Jul 12 09:28:57 2022 +0200

dbghelp: Create lexical relationship between global vars and symt_module.

Global (non static) variables are now stored in symt_module.
(static variables are stored in symt_compiland).

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---

 dlls/dbghelp/symbol.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index a81feb56b8d..4bf0bbae74a 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -299,7 +299,7 @@ struct symt_data* symt_new_global_variable(struct module* module,
         sym->symt.tag      = SymTagData;
         sym->hash_elt.name = pool_strdup(&module->pool, name);
         sym->kind          = is_static ? DataIsFileStatic : DataIsGlobal;
-        sym->container     = compiland ? &compiland->symt : NULL;
+        sym->container     = compiland ? &compiland->symt : &module->top->symt;
         sym->type          = type;
         sym->u.var         = loc;
         if (type && size && symt_get_info(module, type, TI_GET_LENGTH, &tsz))
@@ -310,11 +310,8 @@ struct symt_data* symt_new_global_variable(struct module* module,
                       wine_dbgstr_longlong(tsz), size);
         }
         symt_add_module_ht(module, (struct symt_ht*)sym);
-        if (compiland)
-        {
-            p = vector_add(&compiland->vchildren, &module->pool);
-            *p = &sym->symt;
-        }
+        p = vector_add(compiland ? &compiland->vchildren : &module->top->vchildren, &module->pool);
+        *p = &sym->symt;
     }
     return sym;
 }




More information about the wine-cvs mailing list