summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bcc/express.c7
-rw-r--r--bcc/exptree.c14
2 files changed, 18 insertions, 3 deletions
diff --git a/bcc/express.c b/bcc/express.c
index f57db0a..bceff0e 100644
--- a/bcc/express.c
+++ b/bcc/express.c
@@ -43,7 +43,12 @@ PRIVATE struct nodestruct *cast_exp()
if (vartype->scalar & INT && scalar & (CHAR | SHORT | INT)
&& !((vartype->scalar ^ scalar) & UNSIGNED))
{
- nodeptr->flags &= ~LVALUE;
+/* No ancient switch on low mem systems */
+#ifndef VERY_SMALL_MEMORY
+ /* In ancient UNIX C, casts remain lvalues */
+ if (!ancient)
+#endif
+ nodeptr->flags &= ~LVALUE;
return nodeptr; /* skip casts that are default promotions */
}
return castnode(vartype, nodeptr);
diff --git a/bcc/exptree.c b/bcc/exptree.c
index 04a4534..c5cc09f 100644
--- a/bcc/exptree.c
+++ b/bcc/exptree.c
@@ -358,7 +358,12 @@ struct nodestruct *p2;
needspv(p2);
if (p1->nodetype == p2->nodetype)
{
- p1->flags &= ~LVALUE;
+/* No ancient switch on low mem systems */
+#ifndef VERY_SMALL_MEMORY
+ /* In ancient UNIX C, casts remain lvalues */
+ if (!ancient)
+#endif
+ p1->flags &= ~LVALUE;
return p1;
}
if ((rscalar = p2->nodetype->scalar) & ISCALAR)
@@ -455,7 +460,12 @@ struct nodestruct *p2;
}
else
goto node1;
- p1->flags &= ~LVALUE;
+/* No ancient switch on low mem systems */
+#ifndef VERY_SMALL_MEMORY
+ /* In ancient UNIX C, casts remain lvalues */
+ if (!ancient)
+#endif
+ p1->flags &= ~LVALUE;
p1->nodetype = target->type = p2->nodetype;
return p1;
case INDIRECTOP: