parser: prevents a segfault when _g_ir_parser_parse_string returns NULL error was not set.

Noticed the segmentation fault while using Vala to generate a .gir, a bug has
been filed tomake sure Vala doesn't export gir symbols outside of a namespace
(see https://bugzilla.gnome.org/show_bug.cgi?id=661952)

https://bugzilla.gnome.org/show_bug.cgi?id=661951
This commit is contained in:
Alberto Ruiz 2011-10-18 16:45:38 +01:00
parent b75e788785
commit c87a386cd1

View File

@ -3502,6 +3502,11 @@ _g_ir_parser_parse_string (GIrParser *parser,
if (ctx.modules) if (ctx.modules)
return ctx.modules->data; return ctx.modules->data;
g_set_error (error,
G_MARKUP_ERROR,
G_MARKUP_ERROR_INVALID_CONTENT,
"Expected namespace element in the gir file");
return NULL; return NULL;
} }