zserio
zserio copied to clipboard
Offset expressions should be disabled
Consider the following schema:
struct Schema
{
uint32 myOffsetArray[];
uint8 someValue;
myOffsetArray[@index % someValue]:
string stringArray[];
};
Such schema is not possible to validate during the zserio compilation. It can be valid in some cases. In all cases, it smells because the offsets in myOffsetArray
can be easily overwrite.
Because we can not think of any meaningful use case that would require this, we suggest to completely disable offset expressions except of the simple [@index]
.
For more info, please have a look to the issue #640.