From 85bfc3dc629c33427a664f90bd6551f14f14a507 Mon Sep 17 00:00:00 2001 From: kvigor Date: Thu, 30 Nov 2000 21:00:55 +0000 Subject: [PATCH] fix segfault on casting int to pointer git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@511 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/ralloc.c | 3 ++- src/mcs51/ralloc.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index 96da72af..cb306261 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -1076,7 +1076,8 @@ static void serialRegAssign (eBBlock **ebbs, int count) /* if we need ptr regs for the right side then mark it */ - if (POINTER_GET(ic) && getSize(OP_SYMBOL(IC_LEFT(ic))->type) + if (POINTER_GET(ic) && IS_SYMOP(IC_LEFT(ic)) + && getSize(OP_SYMBOL(IC_LEFT(ic))->type) <= PTRSIZE) { ds390_ptrRegReq++; diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 415d930d..09fd032d 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1076,7 +1076,8 @@ static void serialRegAssign (eBBlock **ebbs, int count) /* if we need ptr regs for the right side then mark it */ - if (POINTER_GET(ic) && getSize(OP_SYMBOL(IC_LEFT(ic))->type) + if (POINTER_GET(ic) && IS_SYMOP(IC_LEFT(ic)) + && getSize(OP_SYMBOL(IC_LEFT(ic))->type) <= PTRSIZE) { mcs51_ptrRegReq++; -- 2.30.2