From 3c9441877f548479fd123621673b460932950231 Mon Sep 17 00:00:00 2001 From: xensik Date: Tue, 16 Nov 2021 17:17:47 +0100 Subject: [PATCH] fix infinite loop --- src/h1/xsk/decompiler.cpp | 2 ++ src/h2/xsk/decompiler.cpp | 2 ++ src/iw5/xsk/decompiler.cpp | 2 ++ src/iw6/xsk/decompiler.cpp | 2 ++ src/iw7/xsk/decompiler.cpp | 2 ++ src/iw8/xsk/decompiler.cpp | 2 ++ src/s1/xsk/decompiler.cpp | 2 ++ src/s2/xsk/decompiler.cpp | 2 ++ src/s4/xsk/decompiler.cpp | 2 ++ 9 files changed, 18 insertions(+) diff --git a/src/h1/xsk/decompiler.cpp b/src/h1/xsk/decompiler.cpp index 9b17398..e95d74e 100644 --- a/src/h1/xsk/decompiler.cpp +++ b/src/h1/xsk/decompiler.cpp @@ -2376,6 +2376,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/h2/xsk/decompiler.cpp b/src/h2/xsk/decompiler.cpp index 3da9bb7..bdf4cda 100644 --- a/src/h2/xsk/decompiler.cpp +++ b/src/h2/xsk/decompiler.cpp @@ -2376,6 +2376,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/iw5/xsk/decompiler.cpp b/src/iw5/xsk/decompiler.cpp index de786e0..a7147b2 100644 --- a/src/iw5/xsk/decompiler.cpp +++ b/src/iw5/xsk/decompiler.cpp @@ -2483,6 +2483,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/iw6/xsk/decompiler.cpp b/src/iw6/xsk/decompiler.cpp index 815e1bd..38ffe6d 100644 --- a/src/iw6/xsk/decompiler.cpp +++ b/src/iw6/xsk/decompiler.cpp @@ -2370,6 +2370,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/iw7/xsk/decompiler.cpp b/src/iw7/xsk/decompiler.cpp index 314ab41..301a958 100644 --- a/src/iw7/xsk/decompiler.cpp +++ b/src/iw7/xsk/decompiler.cpp @@ -2370,6 +2370,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/iw8/xsk/decompiler.cpp b/src/iw8/xsk/decompiler.cpp index 68851a8..6398391 100644 --- a/src/iw8/xsk/decompiler.cpp +++ b/src/iw8/xsk/decompiler.cpp @@ -2426,6 +2426,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/s1/xsk/decompiler.cpp b/src/s1/xsk/decompiler.cpp index 97e857b..fd8eb51 100644 --- a/src/s1/xsk/decompiler.cpp +++ b/src/s1/xsk/decompiler.cpp @@ -2376,6 +2376,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/s2/xsk/decompiler.cpp b/src/s2/xsk/decompiler.cpp index 43b300a..dc0b89a 100644 --- a/src/s2/xsk/decompiler.cpp +++ b/src/s2/xsk/decompiler.cpp @@ -2385,6 +2385,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) diff --git a/src/s4/xsk/decompiler.cpp b/src/s4/xsk/decompiler.cpp index 8b5c147..7486ad6 100644 --- a/src/s4/xsk/decompiler.cpp +++ b/src/s4/xsk/decompiler.cpp @@ -2426,6 +2426,8 @@ void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t s { if(start - index > 0) index++; + else + break; } if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign)