Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: set up builtins initial stack based on program builtins
Problem: when using `allow-missing-builtins` for a program, some builtins requested by the program may not be part of the layout. This results in an incorrect configuration of the initial stack of the program as the program will expect pointers for all builtins, even though it may not access them later down the line. An example of this is any program that invokes another program (ex: the bootloader). Solution: copy the Python VM implementation. We now iterate over the program builtins and set the initial stack of the builtin if it is set up in the VM and a default value of (0, 0) otherwise. When finalizing the stack, we iterate over all Cairo builtins and decrement the stack pointer if the builtin appears in the program and not in the layout.
- Loading branch information