Commit 6c61dfab authored by Gábor Szalai's avatar Gábor Szalai
Browse files

Correcting the call of record/set of RAW decoder



The parameter values of the RAW decoder of the record/set of was faulty:
The value of the first_call parameter was wrong. The number of elements was
passed intead of the first call indication.

Meaning of the parameters:
 - sel_field:  * union -> the selected field to be decoded
               * record of -> the number of the element in the list

 - first_call: * record of -> indicates that the decode is called for the
                              first time or it is a repeated call

Change-Id: I2394eca0392454c7b1c0a2e1b4da4141267e370c
Signed-off-by: Gábor Szalai's avatarGabor Szalai <gabor.szalai@ericsson.com>
parent 8d3279d3
......@@ -5491,23 +5491,28 @@ static char *genRawDecodeRecordField(char *src, const struct_def *sdef,
}
src = mputprintf(src, ", local_top_order, %s",
sdef->elements[i].isOptional ? "TRUE" : "no_err");
boolean lengthof_or_crostag_found = FALSE;
if (sdef->elements[i].hasRaw &&
sdef->elements[i].raw.crosstaglist.nElements > 0)
sdef->elements[i].raw.crosstaglist.nElements > 0){
src = mputstr(src, ", selected_field");
else src = mputstr(src, ", -1");
boolean lengthof_found = FALSE;
for (a = 0; a < raw_options[i].lengthof; a++) {
int field_index = raw_options[i].lengthoffield[a];
/* number of elements in 'record of' or 'set of' */
if (sdef->elements[field_index].raw.unit == -1) {
src = mputprintf(src, ", value_of_length_field%d", field_index);
lengthof_found = TRUE;
break;
lengthof_or_crostag_found = TRUE;
}
else {
for (a = 0; a < raw_options[i].lengthof; a++) {
int field_index = raw_options[i].lengthoffield[a];
/* number of elements in 'record of' or 'set of' */
if (sdef->elements[field_index].raw.unit == -1) {
src = mputprintf(src, ", value_of_length_field%d", field_index);
lengthof_or_crostag_found = TRUE;
break;
}
}
}
if (!lengthof_found) {
src = mputstr(src, ", TRUE");
if (!lengthof_or_crostag_found) {
src = mputstr(src, ", -1");
}
src = mputstr(src, ", TRUE");
src = mputprintf(src, ", &field_%d_force_omit);\n", i);
if (delayed_decode) {
src = mputprintf(src, " if (decoded_field_length != %d) return -1;\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment