From 4685bbbd4e3eeea703d9db477fdceed081fc70de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E9=9B=A8=E9=AD=94=E7=90=86=E6=B2=99?= Date: Wed, 24 Oct 2018 21:20:57 -0700 Subject: [PATCH] [Relay] fix error in typesolver --- src/relay/pass/type_solver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relay/pass/type_solver.h b/src/relay/pass/type_solver.h index 30f82f980a75..193a5976a275 100644 --- a/src/relay/pass/type_solver.h +++ b/src/relay/pass/type_solver.h @@ -128,7 +128,7 @@ class TypeSolver { if (this->parent == nullptr) return this; // slow path with path compression. TypeNode* root = this; - while (root->parent != nullptr) { + while (root->parent != nullptr && root->parent != root) { root = root->parent; } for (TypeNode* p = this; p != root;) {