From 2226ae0bbbf2cbd5ea2da8aaaa04c9c466af56c3 Mon Sep 17 00:00:00 2001 From: winmad Date: Fri, 14 Apr 2023 11:36:19 -0700 Subject: Bugfix: compiler will run forever to eliminate dead code (#2809) * Add a test case that the compile will run forever * Fix. * fix. --------- Co-authored-by: Lifan Wu Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 92da981ad..dd3034da1 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -6889,6 +6889,8 @@ namespace Slang SLANG_ASSERT(other); if (other->getPrevInst() == this) return; + if (other == this) + return; _insertAt(other->getPrevInst(), other, other->getParent()); } -- cgit v1.2.3