diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-10-23 13:53:59 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-10-23 13:53:59 +0000 |
commit | 3f692883f6add50f362c35f216784bdd064b2a12 (patch) | |
tree | d0798470789f575a19a658623a50bb3e25d90d4e /usr.bin/pcc/mip | |
parent | 3eb4523388391cef55636d713ab931aaef6899cf (diff) |
Pull from ragge's repo, commit by mickey:
fix segfault in CDEBUG() use of rnames
Diffstat (limited to 'usr.bin/pcc/mip')
-rw-r--r-- | usr.bin/pcc/mip/reader.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/pcc/mip/reader.c b/usr.bin/pcc/mip/reader.c index 475c0be11bd..a413d36c734 100644 --- a/usr.bin/pcc/mip/reader.c +++ b/usr.bin/pcc/mip/reader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reader.c,v 1.5 2007/10/01 18:51:02 otto Exp $ */ +/* $OpenBSD: reader.c,v 1.6 2007/10/23 13:53:58 otto Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -552,7 +552,8 @@ rewrite(NODE *p, int rewrite, int cookie) tfree(r); if (rewrite == 0) return; - CDEBUG(("rewrite: %p, reg %s\n", p, rnames[DECRA(p->n_reg, 0)])); + CDEBUG(("rewrite: %p, reg %s\n", p, + p->n_reg == -1? "<none>" : rnames[DECRA(p->n_reg, 0)])); p->n_rval = DECRA(p->n_reg, 0); } |