summaryrefslogtreecommitdiff
path: root/sys/src/cmd
diff options
context:
space:
mode:
authorJacob Moody <moody@posixcafe.org>2023-03-17 22:08:14 +0000
committerJacob Moody <moody@posixcafe.org>2023-03-17 22:08:14 +0000
commit613fd6b4294ad3277a91c9a2e58b2b2d4f22ab1c (patch)
treeb33eea1f59937ef3122f28f306703d0f0ae844b5 /sys/src/cmd
parent5664fb3540ae0dccec628720574520122193ab1b (diff)
cc: fix suicide with undefined function arguments
_Noreturn change introduced a check on the type for OFUNC. This will be nil in the event that a symbol given as a function argument is undefined.
Diffstat (limited to 'sys/src/cmd')
-rw-r--r--sys/src/cmd/cc/pgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/cc/pgen.c b/sys/src/cmd/cc/pgen.c
index 2b382bda1..525e196a0 100644
--- a/sys/src/cmd/cc/pgen.c
+++ b/sys/src/cmd/cc/pgen.c
@@ -168,7 +168,7 @@ loop:
case OFUNC:
complex(n);
cgen(n, Z);
- if((n->type->garb & GNORET) == 0)
+ if(n->type == nil || (n->type->garb & GNORET) == 0)
break;
canreach = 0;