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
During ACIR gen the current implementation of memory (once merged) will throw an error when encountering a load instruction for an array element that hasn't been initialised.
Happy Case
The current behaviour is probably the safest approach, but its nonetheless worth revisiting further down the road once we better understand the requirements of dynamic arrays.
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered:
All arrays are initialised in noir, when they are declared. So loading an initialised part of an array is only possible for out-of-bounds indices, which cannot be avoided when we have witness indices.
However, in that case the prover will not be able to generate the proof and we will report an error.
We could add a range-check before any array access to prevent out-of-bound errors on the prover and then report better errors to the user.
Closing this issue since I think we have a good answer for it. Arrays themselves can never be uninitialized but out of bounds accesses are still possible. For these cases we issue a compiler error.
Problem
During ACIR gen the current implementation of memory (once merged) will throw an error when encountering a load instruction for an array element that hasn't been initialised.
Happy Case
The current behaviour is probably the safest approach, but its nonetheless worth revisiting further down the road once we better understand the requirements of dynamic arrays.
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: