mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-12 12:16:04 +08:00
infinite recursion detected in gold testcase
gold/testsuite/icf_test.cc:32:5: error: infinite recursion detected [-Werror=infinite-recursion] 32 | int kept_func() | ^~~~~~~~~ * testsuite/icf_test.cc: Avoid infinite recursion error.
This commit is contained in:
parent
5224aea8c2
commit
b9255b7808
@ -29,19 +29,21 @@ int common()
|
||||
return 1;
|
||||
}
|
||||
|
||||
int kept_func()
|
||||
int kept_func(int i)
|
||||
{
|
||||
common();
|
||||
// Recursive call.
|
||||
kept_func();
|
||||
if (i)
|
||||
kept_func(i - 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int folded_func()
|
||||
int folded_func(int i)
|
||||
{
|
||||
common();
|
||||
// Recursive call.
|
||||
folded_func();
|
||||
if (i)
|
||||
folded_func(i - 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user