zserio icon indicating copy to clipboard operation
zserio copied to clipboard

Argument values of parameterized types for arrays are not properly checked

Open mikir opened this issue 2 years ago • 1 comments

Arguments of parameterized types for arrays are not checked at all during writing. Consider the following:

struct ArrayHolder(varsize size, uint8 extraLimit)
{
    varuint array[size];
    bit:3 extraValue : extraValue <= extraLimit;
};

struct FixedAndVariableParam
{
    uint8 extraLimit;
    ArrayHolder(1000, extraLimit) arrayHolder[];
};

User can initialize any element of arrayHolder array with completely different extraLimit value than field extraLimit contains.

mikir avatar Mar 23 '22 06:03 mikir

Connected to the issue #378.

mikir avatar Mar 23 '22 06:03 mikir