The test uses the trick:
if (!opts) {
opts = &(QOSGraph...Options) { };
}
in a couple of places, however the temporary created
by the &() {} goes out of scope at the bottom of the if,
and results in a seg or assert when opts-> fields are
used (on fedora 30's gcc 9).
Fixes: fc281c802022cb3a73a5
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <
20190405184037.16799-1-dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
{
char *key;
QOSGraphEdgeList *list = g_hash_table_lookup(edge_table, source);
+ QOSGraphEdgeOptions def_opts = { };
if (!list) {
list = g_new0(QOSGraphEdgeList, 1);
}
if (!opts) {
- opts = &(QOSGraphEdgeOptions) { };
+ opts = &def_opts;
}
QOSGraphEdge *edge = g_new0(QOSGraphEdge, 1);
{
QOSGraphNode *node;
char *test_name = g_strdup_printf("%s-tests/%s", interface, name);;
+ QOSGraphTestOptions def_opts = { };
if (!opts) {
- opts = &(QOSGraphTestOptions) { };
+ opts = &def_opts;
}
node = create_node(test_name, QNODE_TEST);
node->u.test.function = test_func;