From: Robert Carr Date: Thu, 17 Dec 2009 22:32:36 +0000 (-0500) Subject: Improve handling of case where constructing struct with 0 size X-Git-Tag: SEED_2_29_5~11 X-Git-Url: http://git.roojs.org/?p=gnome.seed;a=commitdiff_plain;h=a08ec31a2833e681b9c91a62fc1a6f60c4259187 Improve handling of case where constructing struct with 0 size --- diff --git a/libseed/seed-structs.c b/libseed/seed-structs.c index 42b5d52..1c58e0a 100644 --- a/libseed/seed-structs.c +++ b/libseed/seed-structs.c @@ -690,7 +690,12 @@ seed_construct_struct_type_with_parameters (JSContextRef ctx, { size = g_union_info_get_size ((GIUnionInfo *) info); } - g_assert (size); + if (!size) + { + g_critical ("Struct/union of type: %s has size 0 in introspection data. Please check GIR", + g_base_info_get_name (info)); + g_assert(size); + } object = g_slice_alloc0 (size); SEED_NOTE (CONSTRUCTION,