aboutsummaryrefslogtreecommitdiff
path: root/src/prc1/sym.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-10-30 13:56:38 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-10-30 13:56:38 +0100
commit803e95a883a5d3881f662d60cd1a24309bafd4de (patch)
tree8096027380d95ac992dd1cbf22576040eff6b750 /src/prc1/sym.c
parent49d1b87b246f50e5eca25419656188befb4cb85e (diff)
downloadprc-803e95a883a5d3881f662d60cd1a24309bafd4de.tar.gz
WIP
Diffstat (limited to 'src/prc1/sym.c')
-rw-r--r--src/prc1/sym.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/prc1/sym.c b/src/prc1/sym.c
index 69d3bca..3ba2937 100644
--- a/src/prc1/sym.c
+++ b/src/prc1/sym.c
@@ -364,7 +364,7 @@ static const struct type *genlittype(struct prv *p)
{
const struct fn *fn = fn_cur(p);
const char *tr = triplet(p);
- const struct type *byte = type_find(fn, tr, "char");
+ const struct type *byte = type_find(fn, tr, "char"), *ret;
struct type *bytedup = NULL, *t = NULL;
if (!byte)
@@ -384,7 +384,10 @@ static const struct type *genlittype(struct prv *p)
.child = bytedup
};
- return p->ast->littype = type_insert(p, t);
+ if (!(ret = type_insert(p, t)))
+ goto failure;
+
+ return p->ast->littype = ret;
failure:
free(t);