]> granicus.if.org Git - yasm/commitdiff
Fix #85: Multiple may be 0. In this case, force size to zero instead of
authorPeter Johnson <peter@tortall.net>
Thu, 19 Oct 2006 19:42:08 +0000 (19:42 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 19 Oct 2006 19:42:08 +0000 (19:42 -0000)
dividing (and thus crashing).

svn path=/trunk/yasm/; revision=1658

modules/listfmts/nasm/nasm-listfmt.c

index 427ffa355f8238ea0baf4c982e4a0c1b7011c99c..3a8bd962ab4ef0f860b186f7e15b73028ca435ec 100644 (file)
@@ -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;