widl: Set name return value (passed by reference) in the alias case alias case in get_user_type.

Gerald Pfeifer <[email protected]> Sat, 4 Nov 2017 20:21:56 +0100 (CET)
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
So, I admit I don't really know this code, but looking at it (triggered 
by a warning issued by GCC development versions), I noticed that this 
variable passed by reference is not initialized here.

(For reference, "typegen.c:3715:16: warning: 'uname' may be used 
uninitialized in this function" is the warning in question.)

If this is not the right fix, perhaps something else can be changed?

Gerald


Signed-off-by: Gerald Pfeifer <[email protected]>
---
 tools/widl/typegen.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index e63600c71b..32b5eba9b8 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -314,7 +314,11 @@ static type_t *get_user_type(const type_t *t, const char **pname)
         }
 
         if (type_is_alias(t))
+        {
             t = type_alias_get_aliasee(t);
+            if (pname)
+                *pname = t->name;
+        }
         else
             return NULL;
     }
-- 
2.14.1