Fixed a bug: Never remember a pointer to a string buffer, since it becomes
invalid when the string buffer gets resized. git-svn-id: svn://svn.cc65.org/cc65/trunk@5268 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -54,7 +54,7 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
|
|||||||
unsigned SizeBytes;
|
unsigned SizeBytes;
|
||||||
|
|
||||||
/* Remember the current position */
|
/* Remember the current position */
|
||||||
char* A = SB_GetBuf (Type) + SB_GetLen (Type);
|
unsigned Pos = SB_GetLen (Type);
|
||||||
|
|
||||||
/* Add a dummy array token */
|
/* Add a dummy array token */
|
||||||
SB_AppendChar (Type, GT_TYPE_ARRAY);
|
SB_AppendChar (Type, GT_TYPE_ARRAY);
|
||||||
@@ -68,7 +68,7 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
|
|||||||
} while (ArraySize);
|
} while (ArraySize);
|
||||||
|
|
||||||
/* Write the correct array token */
|
/* Write the correct array token */
|
||||||
*A = GT_ARRAY (SizeBytes);
|
SB_GetBuf (Type)[Pos] = GT_ARRAY (SizeBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user