From 09c8ffb63db7e706d0927efb697f30825d21a412 Mon Sep 17 00:00:00 2001 From: johanknol Date: Mon, 11 Jun 2001 16:35:34 +0000 Subject: [PATCH] registered ints can be casted to generic pointers git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@879 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/mcs51/gen.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index b98844ef..8a97a2ec 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -8179,8 +8179,13 @@ genCast (iCode * ic) p_type = DCL_TYPE (type); else { - /* we have to go by the storage class */ - p_type = PTR_TYPE (SPEC_OCLS (etype)); + if (SPEC_SCLS(etype)==S_REGISTER) { + // let's assume it is a generic pointer + p_type=GPOINTER; + } else { + /* we have to go by the storage class */ + p_type = PTR_TYPE (SPEC_OCLS (etype)); + } } /* the first two bytes are known */ @@ -8206,7 +8211,10 @@ genCast (iCode * ic) case CPOINTER: l = "#0x02"; break; - case PPOINTER: + case GPOINTER: + l = "0x03"; + break; + case PPOINTER: // what the fck is this? l = "#0x03"; break; -- 2.47.2