You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, parameters are lightly assumed to be read-only by the code generator, and the code generator will make mistakes if parameters are modified. This mostly affects structs and unions passed by value, as they consume stack memory that is not handled correctly. I believe to fix the actual problems with memory corruption would be rather difficult and would not solve all of the problems.
Instead, I think parameters should be enforced as read-only. This is how most other languages operate. It also allows me to implement compiler optimizations in the future, like transparently passing a reference to a structure because I know it cannot be changed.
The text was updated successfully, but these errors were encountered:
Currently, parameters are lightly assumed to be read-only by the code generator, and the code generator will make mistakes if parameters are modified. This mostly affects structs and unions passed by value, as they consume stack memory that is not handled correctly. I believe to fix the actual problems with memory corruption would be rather difficult and would not solve all of the problems.
Instead, I think parameters should be enforced as read-only. This is how most other languages operate. It also allows me to implement compiler optimizations in the future, like transparently passing a reference to a structure because I know it cannot be changed.
The text was updated successfully, but these errors were encountered: