diff options
author | rsc <devnull@localhost> | 2005-11-28 21:42:45 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-11-28 21:42:45 +0000 |
commit | 4a4a4f2681a61bfd45ec53e47d8eb2cc89ef0408 (patch) | |
tree | e1f58c7a4469a8092e990cd0a09653ddd3f213bc /src/cmd/acidtypes | |
parent | 6637b803f6d99fe3410483ad404ba6f042c13989 (diff) | |
download | plan9port-4a4a4f2681a61bfd45ec53e47d8eb2cc89ef0408.tar.gz plan9port-4a4a4f2681a61bfd45ec53e47d8eb2cc89ef0408.tar.bz2 plan9port-4a4a4f2681a61bfd45ec53e47d8eb2cc89ef0408.zip |
deeper copy in renumber
Diffstat (limited to 'src/cmd/acidtypes')
-rw-r--r-- | src/cmd/acidtypes/type.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/acidtypes/type.c b/src/cmd/acidtypes/type.c index 69bf0157..b8dccb57 100644 --- a/src/cmd/acidtypes/type.c +++ b/src/cmd/acidtypes/type.c @@ -319,6 +319,7 @@ denumber(void) void renumber(TypeList *tl, uint n1) { + int n; Type *t, *tt; for(; tl; tl=tl->tl){ @@ -326,6 +327,21 @@ renumber(TypeList *tl, uint n1) tt = typebynum(n1, t->n2); *tt = *t; tt->n1 = n1; + if(tt->n){ + n = (tt->n+31)&~31; + if(tt->tname){ + tt->tname = emalloc(n*sizeof tt->tname[0]); + memmove(tt->tname, t->tname, n*sizeof tt->tname[0]); + } + if(tt->val){ + tt->val = emalloc(n*sizeof tt->val[0]); + memmove(tt->val, t->val, n*sizeof tt->val[0]); + } + if(tt->t){ + tt->t = emalloc(n*sizeof tt->t[0]); + memmove(tt->t, t->t, n*sizeof tt->t[0]); + } + } addhash(tt); } } |