-
I am wondering why the following does not work (
but this does:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
And this comes from trying to make the READ_INT function in the fibonacci example working with the stack only without using locals, but failing miserably:
|
Beta Was this translation helpful? Give feedback.
-
Hello @pierrec I tried your example above and was also surprised for a moment that it does not work 😆 The reason is that set_local will pop the value you just pushed, and then you end up with stack size 0.
To make it work, you would need to allocate another stack slot:
|
Beta Was this translation helpful? Give feedback.
Hello @pierrec
I tried your example above and was also surprised for a moment that it does not work 😆
The reason is that set_local will pop the value you just pushed, and then you end up with stack size 0.
To make it work, you would need to allocate another stack slot: