summaryrefslogtreecommitdiff
path: root/compiler_and_linker/unsorted/CExpr.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-20 00:39:43 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-20 00:39:43 +0000
commit7d986adf37220e1981a707745b784b078de4e3bc (patch)
tree831dea5f470c0c6b3c373f38d3a5f0354bc22600 /compiler_and_linker/unsorted/CExpr.c
parent4d670146b4054e11e90227f96a3a1c66410e8d0b (diff)
downloadMWCC-7d986adf37220e1981a707745b784b078de4e3bc.tar.gz
MWCC-7d986adf37220e1981a707745b784b078de4e3bc.zip
fix various inaccuracies exposed by the mach ppc plugin
Diffstat (limited to 'compiler_and_linker/unsorted/CExpr.c')
-rw-r--r--compiler_and_linker/unsorted/CExpr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler_and_linker/unsorted/CExpr.c b/compiler_and_linker/unsorted/CExpr.c
index 992fc09..500ae57 100644
--- a/compiler_and_linker/unsorted/CExpr.c
+++ b/compiler_and_linker/unsorted/CExpr.c
@@ -1649,7 +1649,7 @@ static ENode *primary_expression(Boolean flag) {
else
tk = lex();
if (ENODE_IS(expr, EASS))
- expr->flags |= ENODE_FLAG_80;
+ expr->flags = expr->flags | ENODE_FLAG_80;
return expr;
case '[':
if (copts.objective_c)
@@ -2227,7 +2227,7 @@ restart:
}
if (obj->datatype == DINLINEFUNC)
CError_Error(CErrorStr175);
- obj->flags |= OBJECT_FLAGS_2;
+ obj->flags = obj->flags | OBJECT_FLAGS_2;
if (flag && !copts.cplusplus && obj->sclass == TK_REGISTER)
CError_Error(CErrorStr163);
break;
@@ -2806,7 +2806,7 @@ static ENode *CExpr_MemberPointerCast(ENode *expr, TypeMemberPointer *type, UInt
ENode *do_typecast(ENode *expr, Type *type, UInt32 qual) {
TypePointer *tptr;
ENode *tmp;
- UInt32 flags;
+ short flags;
if (!copts.old_argmatch)
return CExpr_Convert(expr, type, qual, 1, 0);
@@ -2830,7 +2830,7 @@ ENode *do_typecast(ENode *expr, Type *type, UInt32 qual) {
flags = qual & ENODE_FLAG_QUALS;
if (ENODE_IS(expr, EOBJLIST))
- return CExpr_AssignmentPromotion(expr, type, flags, 1);
+ return CExpr_AssignmentPromotion(expr, type, qual & ENODE_FLAG_QUALS, 1);
if (ENODE_IS(expr, EOBJREF) && IS_TYPE_NONSTATIC_METHOD(expr->data.objref->type)) {
CError_Error(CErrorStr221);
@@ -2898,7 +2898,7 @@ ENode *do_typecast(ENode *expr, Type *type, UInt32 qual) {
if (ENODE_IS(expr, ETYPCON) && expr->rtype->type == type->type && expr->rtype->size == type->size) {
if (is_unsigned(expr->rtype) == is_unsigned(type) && ENODE_QUALS(expr) == qual) {
expr->rtype = type;
- expr->flags |= ENODE_FLAG_80;
+ expr->flags = expr->flags | ENODE_FLAG_80;
return expr;
}
}
@@ -4153,14 +4153,14 @@ ENode *CExpr_New_ECOND_Node(ENode *cond, ENode *expr1, ENode *expr2) {
result->rtype = expr1->rtype;
result->flags = expr1->flags | expr2->flags;
result->data.cond.cond = cond;
- if (ENODE_IS(expr1, EFUNCCALL) && expr1->rtype == &stvoid && (expr1->flags & ENODE_FLAG_VOLATILE)) {
+ if (ENODE_IS(expr1, EFUNCCALL) && expr1->rtype == &stvoid && (expr1->flags & ENODE_FLAG_VOLATILE) != 0) {
result->rtype = expr2->rtype;
result->flags = expr2->flags;
result->data.cond.expr1 = expr1;
result->data.cond.expr2 = expr2;
return result;
}
- if (ENODE_IS(expr2, EFUNCCALL) && expr2->rtype == &stvoid && (expr2->flags & ENODE_FLAG_VOLATILE)) {
+ if (ENODE_IS(expr2, EFUNCCALL) && expr2->rtype == &stvoid && (expr2->flags & ENODE_FLAG_VOLATILE) != 0) {
result->rtype = expr1->rtype;
result->flags = expr1->flags;
result->data.cond.expr1 = expr1;