Cleaned up some more mess. Everything should be the same now as on the 12th
[fw/sdcc] / src / SDCCicode.c
index 2792ef48ee309608fca56056e07328998647937c..dd464450e0a82984aa1fd519da6fbad42e67b759 100644 (file)
@@ -2559,6 +2559,11 @@ geniCodeDerefPtr (operand * op,int lvl)
 
   op->isGptr = IS_GENPTR (optype);
 
+  /* if the pointer was declared as a constant */
+  /* then we cannot allow assignment to the derefed */
+  if (IS_PTR_CONST (optype))
+    SPEC_CONST (retype) = 1;
+
   op->isaddr = (IS_PTR (rtype) ||
                IS_STRUCT (rtype) ||
                IS_INT (rtype) ||