From: Michael Wallner Date: Tue, 5 Sep 2017 06:52:47 +0000 (+0200) Subject: null pointer safeguards X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ed8afff1d0e557ee702852f6e293c42c621d16e3;p=m6w6%2Fext-psi null pointer safeguards --- 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; }