solidity/test/libyul/yulOptimizerTests/functionSpecializer/recursion.yul
hrkrshnn 0100f48e05 FunctionSpecializer: skip specializing recursive functions
This avoids potential pathological behaviour, like in Ackermann function.
2021-03-29 11:02:31 +02:00

26 lines
415 B
Plaintext

{
sstore(0, fib(8))
function fib(i) -> y
{
y := 1
if gt(i, 2)
{
y := add(fib(sub(i, 1)), fib(sub(i, 2)))
}
}
}
// ----
// step: functionSpecializer
//
// {
// sstore(0, fib(8))
// function fib(i) -> y
// {
// y := 1
// if gt(i, 2)
// {
// y := add(fib(sub(i, 1)), fib(sub(i, 2)))
// }
// }
// }