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:
parent
d225866449
commit
262ed5db8b
1 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
|
|||
unsigned SizeBytes;
|
||||
|
||||
/* Remember the current position */
|
||||
char* A = SB_GetBuf (Type) + SB_GetLen (Type);
|
||||
unsigned Pos = SB_GetLen (Type);
|
||||
|
||||
/* Add a dummy array token */
|
||||
SB_AppendChar (Type, GT_TYPE_ARRAY);
|
||||
|
@ -68,7 +68,7 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
|
|||
} while (ArraySize);
|
||||
|
||||
/* Write the correct array token */
|
||||
*A = GT_ARRAY (SizeBytes);
|
||||
SB_GetBuf (Type)[Pos] = GT_ARRAY (SizeBytes);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue