(length_type): TSequenceOf: add up the size of all the elements, don't

use just the size of the last element.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13276 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2004-01-19 17:54:33 +00:00
parent ed8f26660d
commit de222a34c8

View File

@@ -126,8 +126,12 @@ length_type (const char *name, const Type *t, const char *variable)
variable, variable);
fprintf (codefile, "for(i = (%s)->len - 1; i >= 0; --i){\n", name);
fprintf (codefile, "int oldret = %s;\n"
"%s = 0;\n", variable, variable);
asprintf (&n, "&(%s)->val[i]", name);
length_type(n, t->subtype, variable);
fprintf (codefile, "%s += oldret;\n",
variable);
fprintf (codefile, "}\n");
fprintf (codefile,