From ad2c07f49c326140a0839e6453fb68bb48745781 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 7 Jan 2015 19:56:25 -0300 Subject: [PATCH] dump.c (order_vecs): don't trip over vectors with deferred resolution This caused segfaults in code view and dumping with -T -T. --- dump.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dump.c b/dump.c index 3c23415..1b78a51 100644 --- a/dump.c +++ b/dump.c @@ -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); + } }