undid the hackup of const and volatile, the problem is much bigger
[fw/sdcc] / src / SDCCval.c
index 687a2a3f34cba86ca943687f11d2e008966663ba..d944b5c8cd38ec6fed8f35ac4946bc1250d6854b 100644 (file)
@@ -1537,6 +1537,7 @@ valForArray (ast * arrExpr)
   if (SPEC_SCLS (arrExpr->left->etype) == S_CODE)
     {
       DCL_TYPE (val->type) = CPOINTER;
+      DCL_PTR_CONST (val->type) = port->mem.code_ro;
     }
   else if (SPEC_SCLS (arrExpr->left->etype) == S_XDATA)
     DCL_TYPE (val->type) = FPOINTER;
@@ -1607,6 +1608,7 @@ valForStructElem (ast * structT, ast * elemT)
   if (SPEC_SCLS (structT->etype) == S_CODE)
     {
       DCL_TYPE (val->type) = CPOINTER;
+      DCL_PTR_CONST (val->type) = port->mem.code_ro;
     }
   else if (SPEC_SCLS (structT->etype) == S_XDATA)
     DCL_TYPE (val->type) = FPOINTER;