- if (ctype_match (ctype_makePointer (ct2), tfrom))
- {
- /*a bit of a sloopy way to do this but... */
- constraintExpr_free(e);
- return constraintExpr_makeExprNode (t1);
+ voptgenerror (FLG_ALLOCMISMATCH,
+ message ("Allocated memory is used as a different type (%s) from the sizeof type (%s)",
+ ctype_unparse (tobase), ctype_unparse (multype)),
+ loc);
+
+ if (sizemul == sizeto)
+ {
+ constraintExpr_free (e);
+ DPRINTF (("Sizeof types match okay!"));
+ return constraintExpr_makeExprNode (t2);
+ }
+ else
+ {
+ /* nothing was here */
+ DPRINTF (("MISMATCHING TYPES!"));
+ return (constraintExpr_div (constraintExpr_makeExprNode (t2), multype, tto, loc));
+ }