Skip to content

Commit ea41487

Browse files
authored
Fix empty formula generation for self-recursive functions (#631)
1 parent 17fd7fe commit ea41487

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/form/formula_simplify.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,13 @@ bool isSimpleRecursiveReference(const Formula& formula,
389389
}
390390

391391
refFuncName = rhs.name;
392+
393+
// Skip if the function references itself (self-recursion, not a simple
394+
// reference)
395+
if (refFuncName == funcName) {
396+
return false;
397+
}
398+
392399
const auto& arg = rhs.children.front();
393400

394401
// Skip if the referenced function was already processed

0 commit comments

Comments
 (0)