]> granicus.if.org Git - yasm/commitdiff
errwarn_new(): Fix bug that could cause infinite loops.
authorPeter Johnson <peter@tortall.net>
Thu, 26 Sep 2002 18:00:16 +0000 (18:00 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 26 Sep 2002 18:00:16 +0000 (18:00 -0000)
svn path=/trunk/yasm/; revision=709

libyasm/errwarn.c
src/errwarn.c

index efcf3cd32743c6ccf3496bbd76a29462128b4639..47d72b6690cd937813354e568737799f0005a5e8 100644 (file)
@@ -164,6 +164,8 @@ errwarn_new(unsigned long lindex, int replace_parser_error)
            action = INS_AFTER;
        else if (lindex >= ins_we->line && lindex < next->line)
            action = INS_AFTER;
+       else
+           ins_we = next;
     }
 
     if (replace_parser_error && ins_we && ins_we->type == WE_PARSERERROR) {
index efcf3cd32743c6ccf3496bbd76a29462128b4639..47d72b6690cd937813354e568737799f0005a5e8 100644 (file)
@@ -164,6 +164,8 @@ errwarn_new(unsigned long lindex, int replace_parser_error)
            action = INS_AFTER;
        else if (lindex >= ins_we->line && lindex < next->line)
            action = INS_AFTER;
+       else
+           ins_we = next;
     }
 
     if (replace_parser_error && ins_we && ins_we->type == WE_PARSERERROR) {