* src/SDCCast.c (createIvalArray): removed obsolete comment
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3979
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2005-11-24 Bernhard Held <bernhard AT bernhardheld.de>
+
+ * src/SDCCsymt.c (copyLinkChain): fixed bug 770487, copy structdef
+ and fields-list too
+ * src/SDCCast.c (createIvalArray): removed obsolete comment
+
2005-11-24 Borut Razem <borut.razem AT siol.net>
* sdcc/device/lib/Makefile.in: remove all unnecessary files, 2nd try...
2005-11-24 Borut Razem <borut.razem AT siol.net>
* sdcc/device/lib/Makefile.in: remove all unnecessary files, 2nd try...
/* if we have not been given a size */
if (!DCL_ELEM (type))
{
/* if we have not been given a size */
if (!DCL_ELEM (type))
{
- /* but this still updates the typedef instead of the instance ! see bug 770487 */
DCL_ELEM (type) = size;
}
DCL_ELEM (type) = size;
}
+/*------------------------------------------------------------------*/
+/* copyStruct - copies a structdef including the fields-list */
+/*------------------------------------------------------------------*/
+static structdef *
+copyStruct (structdef *src)
+{
+ structdef *dest;
+
+ dest = newStruct ("");
+ memcpy (dest, src, sizeof (structdef));
+ dest->fields = copySymbolChain (src->fields);
+ return dest;
+}
+
/*------------------------------------------------------------------*/
/* sclsFromPtr - Return the storage class a pointer points into. */
/* S_FIXED is returned for generic pointers or other */
/*------------------------------------------------------------------*/
/* sclsFromPtr - Return the storage class a pointer points into. */
/* S_FIXED is returned for generic pointers or other */
while (curr)
{
memcpy (loop, curr, sizeof (sym_link)); /* copy it */
while (curr)
{
memcpy (loop, curr, sizeof (sym_link)); /* copy it */
+ if (IS_STRUCT (loop))
+ SPEC_STRUCT (loop) = copyStruct (SPEC_STRUCT (loop));
loop->next = (curr->next ? newLink (curr->next->class) : (void *) NULL);
loop = loop->next;
curr = curr->next;
loop->next = (curr->next ? newLink (curr->next->class) : (void *) NULL);
loop = loop->next;
curr = curr->next;