git: 9front

Download patch

ref: 38eae858b6ca15dfe32f1ff71ab6e72e3217b294
parent: ee8e84b6b66bcdf20bcabf25d87374f85ba871d9
author: Jacob Moody <moody@posixcafe.org>
date: Fri Mar 17 18:08:14 EDT 2023

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.

--- a/sys/src/cmd/cc/pgen.c
+++ b/sys/src/cmd/cc/pgen.c
@@ -168,7 +168,7 @@
 	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;
--