shithub: riscv

Download patch

ref: 789a6430296fd5b0dadddda1b815c57abc485594
parent: 75b5e92d61a5b92846f7b8e3c038a2eedc2a8623
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jan 13 23:26:31 EST 2023

pic: error instead of crashing on nonexistent variables

--- a/sys/src/cmd/pic/misc.c
+++ b/sys/src/cmd/pic/misc.c
@@ -370,7 +370,7 @@
 	static YYSTYPE bug;
 	struct symtab *stp;
 
-	if (p->o_type != BLOCK) {
+	if (p == NULL || p->o_type != BLOCK) {
 		ERROR ".%s is not in that block", s WARNING;
 		return(bug);
 	}