More AVR stuff
[fw/sdcc] / src / SDCCval.c
index c1dff7198a18a9aeaf2581cb8c2cbf812c849d50..daf3f930f4c6497b6ea7bbbde5a9056370864bc7 100644 (file)
@@ -1201,7 +1201,7 @@ value *valForArray (ast *arrExpr)
     val->type = newLink();    
     if (SPEC_SCLS(arrExpr->left->etype) == S_CODE) {
        DCL_TYPE(val->type) = CPOINTER ;
-       DCL_PTR_CONST(val->type) = 1;
+       DCL_PTR_CONST(val->type) = port->mem.code_ro;
     }
     else
        if (SPEC_SCLS(arrExpr->left->etype) == S_XDATA)
@@ -1270,7 +1270,7 @@ value *valForStructElem(ast *structT, ast *elemT)
     val->type = newLink();
     if (SPEC_SCLS(structT->etype) == S_CODE) {
        DCL_TYPE(val->type) = CPOINTER ;
-       DCL_PTR_CONST(val->type) = 1;
+       DCL_PTR_CONST(val->type) = port->mem.code_ro;
     }
     else
        if (SPEC_SCLS(structT->etype) == S_XDATA)