Fixed several const related bugs
git-svn-id: svn://svn.cc65.org/cc65/trunk@1165 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
0f911ef8d4
commit
0a4799c975
1 changed files with 4 additions and 4 deletions
|
@ -2280,7 +2280,7 @@ static void parsesub (int k, ExprDesc* lval)
|
||||||
/* Operate on pointers, result type is a pointer */
|
/* Operate on pointers, result type is a pointer */
|
||||||
} else if (IsClassPtr (lhst) && IsClassPtr (rhst)) {
|
} else if (IsClassPtr (lhst) && IsClassPtr (rhst)) {
|
||||||
/* Left is pointer, right is pointer, must scale result */
|
/* Left is pointer, right is pointer, must scale result */
|
||||||
if (TypeCmp (Indirect (lhst), Indirect (rhst)) < TC_EQUAL) {
|
if (TypeCmp (Indirect (lhst), Indirect (rhst)) < TC_QUAL_DIFF) {
|
||||||
Error ("Incompatible pointer types");
|
Error ("Incompatible pointer types");
|
||||||
} else {
|
} else {
|
||||||
lval->ConstVal = (lval->ConstVal - lval2.ConstVal) / PSizeOf (lhst);
|
lval->ConstVal = (lval->ConstVal - lval2.ConstVal) / PSizeOf (lhst);
|
||||||
|
@ -2315,7 +2315,7 @@ static void parsesub (int k, ExprDesc* lval)
|
||||||
flags = CF_PTR;
|
flags = CF_PTR;
|
||||||
} else if (IsClassPtr (lhst) && IsClassPtr (rhst)) {
|
} else if (IsClassPtr (lhst) && IsClassPtr (rhst)) {
|
||||||
/* Left is pointer, right is pointer, must scale result */
|
/* Left is pointer, right is pointer, must scale result */
|
||||||
if (TypeCmp (Indirect (lhst), Indirect (rhst)) < TC_EQUAL) {
|
if (TypeCmp (Indirect (lhst), Indirect (rhst)) < TC_QUAL_DIFF) {
|
||||||
Error ("Incompatible pointer types");
|
Error ("Incompatible pointer types");
|
||||||
} else {
|
} else {
|
||||||
rscale = PSizeOf (lhst);
|
rscale = PSizeOf (lhst);
|
||||||
|
@ -2358,7 +2358,7 @@ static void parsesub (int k, ExprDesc* lval)
|
||||||
flags = CF_PTR;
|
flags = CF_PTR;
|
||||||
} else if (IsClassPtr (lhst) && IsClassPtr (rhst)) {
|
} else if (IsClassPtr (lhst) && IsClassPtr (rhst)) {
|
||||||
/* Left is pointer, right is pointer, must scale result */
|
/* Left is pointer, right is pointer, must scale result */
|
||||||
if (TypeCmp (Indirect (lhst), Indirect (rhst)) < TC_EQUAL) {
|
if (TypeCmp (Indirect (lhst), Indirect (rhst)) < TC_QUAL_DIFF) {
|
||||||
Error ("Incompatible pointer types");
|
Error ("Incompatible pointer types");
|
||||||
} else {
|
} else {
|
||||||
rscale = PSizeOf (lhst);
|
rscale = PSizeOf (lhst);
|
||||||
|
@ -3025,7 +3025,7 @@ static void Assignment (ExprDesc* lval)
|
||||||
g_push (CF_PTR | CF_UNSIGNED, 0);
|
g_push (CF_PTR | CF_UNSIGNED, 0);
|
||||||
|
|
||||||
/* Check for equality of the structs */
|
/* Check for equality of the structs */
|
||||||
if (TypeCmp (ltype, lval2.Type) < TC_EQUAL) {
|
if (TypeCmp (ltype, lval2.Type) < TC_STRICT_COMPATIBLE) {
|
||||||
Error ("Incompatible types");
|
Error ("Incompatible types");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue