mirror of
https://github.com/cc65/cc65.git
synced 2024-10-12 15:23:54 +00:00
Fix the check for constant static local data, which was wrong when the data
was an array. It should go into RODATA, not DATA. git-svn-id: svn://svn.cc65.org/cc65/trunk@4669 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
05b23194d9
commit
64b597017a
@ -355,8 +355,12 @@ static unsigned ParseStaticDecl (Declaration* Decl, unsigned* SC)
|
|||||||
/* Static data */
|
/* Static data */
|
||||||
if (CurTok.Tok == TOK_ASSIGN) {
|
if (CurTok.Tok == TOK_ASSIGN) {
|
||||||
|
|
||||||
/* Initialization ahead, switch to data segment and define a label */
|
/* Initialization ahead, switch to data segment and define a label.
|
||||||
if (IsQualConst (Decl->Type)) {
|
* For arrays, we need to check the elements of the array for
|
||||||
|
* constness, not the array itself.
|
||||||
|
*/
|
||||||
|
if (IsQualConst (Decl->Type) ||
|
||||||
|
(IsTypeArray (Decl->Type) && IsQualConst (GetElementType (Decl->Type)))) {
|
||||||
SymData = AllocLabel (g_userodata);
|
SymData = AllocLabel (g_userodata);
|
||||||
} else {
|
} else {
|
||||||
SymData = AllocLabel (g_usedata);
|
SymData = AllocLabel (g_usedata);
|
||||||
|
Loading…
Reference in New Issue
Block a user