From e9e00fcef2b2f68dbcc003a18c205b2f41d19c96 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 26 Sep 2002 18:00:16 +0000 Subject: [PATCH] errwarn_new(): Fix bug that could cause infinite loops. svn path=/trunk/yasm/; revision=709 --- libyasm/errwarn.c | 2 ++ src/errwarn.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index efcf3cd3..47d72b66 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -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) { diff --git a/src/errwarn.c b/src/errwarn.c index efcf3cd3..47d72b66 100644 --- a/src/errwarn.c +++ b/src/errwarn.c @@ -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) { -- 2.40.0