summaryrefslogtreecommitdiff
path: root/sys/src/cmd/pic
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2023-01-14 04:26:31 +0000
committerOri Bernstein <ori@eigenstate.org>2023-01-14 04:26:31 +0000
commit789a6430296fd5b0dadddda1b815c57abc485594 (patch)
tree871e6d022e1fa33820ef65fd2f590d5a7bafba10 /sys/src/cmd/pic
parent75b5e92d61a5b92846f7b8e3c038a2eedc2a8623 (diff)
pic: error instead of crashing on nonexistent variables
Diffstat (limited to 'sys/src/cmd/pic')
-rw-r--r--sys/src/cmd/pic/misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/pic/misc.c b/sys/src/cmd/pic/misc.c
index e9ec76c9f..13982cf25 100644
--- a/sys/src/cmd/pic/misc.c
+++ b/sys/src/cmd/pic/misc.c
@@ -370,7 +370,7 @@ YYSTYPE getblk(obj *p, char *s) /* find union type for s in p */
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);
}