aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-06-05 10:28:57 +0200
committerlemon <lsof@mailbox.org>2023-06-05 10:58:35 +0200
commited47a54958f5bd48dc364d4a0f77f778768696bb (patch)
treec68f7b1426c198964b37238c6195f0569a15ab2b /parse.c
parentefc0cf8039cbff5e0f0d52fd7414c7186129b6ac (diff)
strlits
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 4ed63c7..0dd984d 100644
--- a/parse.c
+++ b/parse.c
@@ -977,7 +977,6 @@ exprvalue(struct function *fn, const struct expr *ex)
{
return compileexpr(fn, ex, /*discard*/ 0);
}
-
static inline void
expreffects(struct function *fn, const struct expr *ex)
{
@@ -1025,6 +1024,8 @@ expraddr(struct function *fn, const struct expr *ex)
assert(0);
}
break;
+ case ESTRLIT:
+ return mkdatref(fn, ex->s.n+1, /*align*/ 1, ex->s.p, ex->s.n);
case EDEREF:
return exprvalue(fn, ex->sub);
case EGETF:
@@ -1352,7 +1353,8 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard)
sub = ex->sub;
if (ex->ty.t != TYVOID && !isscalar(ex->ty))
- /* fn & array designators evaluate to their address; so do aggregates for the purpose of code generation */
+ /* fn & array designators evaluate to their address;
+ * so do aggregates for the purpose of code generation */
return expraddr(fn, ex);
switch (ex->t) {
case ENUMLIT: