mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
0100f48e05
This avoids potential pathological behaviour, like in Ackermann function.
26 lines
415 B
Plaintext
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)))
|
|
// }
|
|
// }
|
|
// }
|