From 6ab452816c09df2c8e47afedc445d234ae8fadd0 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 19 Oct 2006 19:42:08 +0000 Subject: [PATCH] Fix #85: Multiple may be 0. In this case, force size to zero instead of dividing (and thus crashing). svn path=/trunk/yasm/; revision=1658 --- modules/listfmts/nasm/nasm-listfmt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index 427ffa35..3a8bd962 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -217,7 +217,10 @@ nasm_listfmt_output(yasm_listfmt *listfmt, FILE *f, yasm_linemap *linemap, bigbuf = yasm_bc_tobytes(bc, buf, &size, &gap, &info, nasm_listfmt_output_value, NULL); yasm_bc_get_multiple(bc, &multiple, 1); - size /= multiple; + if (multiple == 0) + size = 0; + else + size /= multiple; /* output bytes with reloc information */ origp = bigbuf ? bigbuf : buf; -- 2.40.0