Message ID | 20170319180118.83953-1-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
On Sun, Mar 19, 2017 at 11:01 AM, Luc Van Oostenryck <luc.vanoostenryck@gmail.com> wrote: > When verbose is set to 2 or higher, show_instruction() > also display removed instructions. Some of these instructions > can have their associated symbol removed and set to NULL > which will cause a crash with 'test-linearize -vv'. > > Fix this by avoiding to dereference symbol's details of > removed instructions. I like to apply it. Can you add SOB? Thanks Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Mar 23, 2017 at 08:03:36PM -0700, Christopher Li wrote: > On Sun, Mar 19, 2017 at 11:01 AM, Luc Van Oostenryck > <luc.vanoostenryck@gmail.com> wrote: > > When verbose is set to 2 or higher, show_instruction() > > also display removed instructions. Some of these instructions > > can have their associated symbol removed and set to NULL > > which will cause a crash with 'test-linearize -vv'. > > > > Fix this by avoiding to dereference symbol's details of > > removed instructions. > > I like to apply it. Can you add SOB? Sure. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/linearize.c b/linearize.c index 4ebd6d6d8..1bbada887 100644 --- a/linearize.c +++ b/linearize.c @@ -319,6 +319,8 @@ const char *show_instruction(struct instruction *insn) struct symbol *sym = insn->symbol->sym; buf += sprintf(buf, "%s <- ", show_pseudo(insn->target)); + if (!insn->bb && !sym) + break; if (sym->bb_target) { buf += sprintf(buf, ".L%u", sym->bb_target->nr); break;