From ed8afff1d0e557ee702852f6e293c42c621d16e3 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 5 Sep 2017 08:52:47 +0200 Subject: [PATCH] null pointer safeguards --- src/types/decl_type.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/types/decl_type.c b/src/types/decl_type.c index afab9e3..dbaa171 100644 --- a/src/types/decl_type.c +++ b/src/types/decl_type.c @@ -300,11 +300,15 @@ void psi_decl_type_dump_args_with_layout(int fd, struct psi_plist *args, while (psi_plist_get(args, i++, &sarg)) { dprintf(fd, "%s", psi_t_indent(level)); psi_decl_arg_dump(fd, sarg, level); - if (sarg->layout->bfw) { - dprintf(fd, ":%zu", sarg->layout->bfw->len); + if (sarg->layout) { + if (sarg->layout->bfw) { + dprintf(fd, ":%zu", sarg->layout->bfw->len); + } + dprintf(fd, "::(%zu, %zu);\n", sarg->layout->pos, + sarg->layout->len); + } else { + dprintf(fd, ";\n"); } - dprintf(fd, "::(%zu, %zu);\n", sarg->layout->pos, - sarg->layout->len); } --level; } -- 2.30.2