At the time of writing, the simulator, the AVM circuit, and brillig do not handle uninitialized memory read in the same way:
- circuit reads value 0 of type U0 and coerce this to the expected type to be read (double check edge cases)
- brillig VM read type U0 but does not coerce to other types (technically speaking, it reads
value:0 bit_size:0; you can do operations among u0s but adding a u0 to another type will fail)
- avm simulator does not have a concept of u0; reading uninitialized data will result in an
undefined object
Currently, on Noir-generated bytecode, the only case that is reading (and writing) uninitialized memory is the case of (C)MOV. Brillig does generate a move of uninitialized data when dumping the stack. For all other cases, data is currently initialized (as of July 2024).
There should be some agreement before completion of the project on this.
At the time of writing, the simulator, the AVM circuit, and brillig do not handle uninitialized memory read in the same way:
value:0 bit_size:0; you can do operations amongu0s but adding au0to another type will fail)undefinedobjectCurrently, on Noir-generated bytecode, the only case that is reading (and writing) uninitialized memory is the case of
(C)MOV. Brillig does generate a move of uninitialized data when dumping the stack. For all other cases, data is currently initialized (as of July 2024).There should be some agreement before completion of the project on this.