1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-21 20:35:21 +02:00

dump.c (order_vecs): don't trip over vectors with deferred resolution

This caused segfaults in code view and dumping with -T -T.
This commit is contained in:
Werner Almesberger 2015-01-07 19:56:25 -03:00
parent 8a1a310396
commit ad2c07f49c

11
dump.c
View File

@ -1,8 +1,8 @@
/*
* dump.c - Dump objects in the native FPD format
*
* Written 2009-2012, 2014 by Werner Almesberger
* Copyright 2009-2012, 2014 by Werner Almesberger
* Written 2009-2012, 2014-2015 by Werner Almesberger
* Copyright 2009-2012, 2014-2015 by Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -170,9 +170,12 @@ static void order_vecs(struct order **curr, struct vec *vecs)
{
struct vec *vec;
for (vec = vecs; vec; vec = vec->next)
if (!vec->base || n_vec_refs(vec->base) != 1)
for (vec = vecs; vec; vec = vec->next) {
const char *name = (const char *) vec->base;
if (!vec->base || *name || n_vec_refs(vec->base) != 1)
recurse_vec(curr, vec);
}
}