Referenced-index-protection feature for component variables (RT2)
Titan has a feature (in runtime2), that protects certain indexes of a record of/set of/array from being deleted, if it is referenced by an 'inout' actual parameter. This allows the user to pass both a record of/set of/array and one of its elements to a function as two 'inout' actual parameters, and the element will still point to valid memory if a new value is assigned to the record of/set of/array inside the function.
According to the TTCN-3 standard (section 5.4.2), an element of a structure cannot be passed as an 'inout' actual parameter if the structure is also passed as an 'inout' actual parameter to the same function (see #620 (closed)). This has been implemented, and the referenced-index-protection feature was removed.
However, the standard also states, in example 4 of the same section, that an element of a component variable structure can be passed as an 'inout' actual parameter to a function, where the component variable is visible, and the parameter and component variable affect one-another when changed.
So, the referenced-index-protection feature needs to be re-added, but only for parameters referencing elements of component variables.
/cc @aknappqwt @mmagyari