From: kvigor Date: Thu, 30 Nov 2000 21:00:55 +0000 (+0000) Subject: fix segfault on casting int to pointer X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=85bfc3dc629c33427a664f90bd6551f14f14a507;p=fw%2Fsdcc 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 --- 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++;