shithub: riscv

Download patch

ref: aeef9d3ae4f43b775de71d5f0b65d7ec984e8912
parent: 63003069e3812b6f7a53996967919404635dfeef
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 25 13:59:23 EST 2025

cc: don't crash on empty args for USED()/SET()

	this is useful to mark a branch as reachable.
	and even if it wasn't, we shouldn't crash when
	someone writes this.

--- a/sys/src/cmd/cc/pgen.c
+++ b/sys/src/cmd/cc/pgen.c
@@ -559,6 +559,8 @@
 void
 usedset(Node *n, int o)
 {
+	if(n == Z)
+		return;
 	if(n->op == OLIST) {
 		usedset(n->left, o);
 		usedset(n->right, o);
--