case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
+
+ default:
+ werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ "genPointerSet: illegal pointer type");
}
}
/* pointer to generic pointer */
if (IS_GENPTR (ctype)) {
- char *l = zero;
-
if (IS_PTR (type))
p_type = DCL_TYPE (type);
else {
aopGet (AOP (right), offset), offset);
offset++;
}
- /* the last byte depending on type */
- switch (p_type) {
- case IPOINTER:
- case POINTER:
- l = zero;
- break;
- case FPOINTER:
- l = one;
- break;
- case CPOINTER:
- l = "0x02";
- break;
- case PPOINTER:
- l = "0x03";
- break;
-
- default:
- /* this should never happen */
- werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
- "got unknown pointer type");
- exit (1);
+
+ /* the last byte depending on type */
+ {
+ int gpVal = pointerTypeToGPByte(p_type, NULL, NULL);
+ char gpValStr[10];
+
+ if (gpVal == -1)
+ {
+ // pointerTypeToGPByte will have bitched.
+ exit(1);
}
- aopPut (AOP (result), l, GPTRSIZE - 1);
- goto release;
+
+ sprintf(gpValStr, "#0x%d", gpVal);
+ aopPut (AOP (result), gpValStr, GPTRSIZE - 1);
+ }
+ goto release;
}
/* just copy the pointers */