Browse Source

* when determining the type to use for checkcast, first always dereference
pointers to implicit pointer types so that afterwards we can set the
appropriate corresponding class type

git-svn-id: branches/jvmbackend@18668 -

Jonas Maebe 14 years ago
parent
commit
7286e3b645
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/jvm/njvmcnv.pas

+ 3 - 2
compiler/jvm/njvmcnv.pas

@@ -1192,10 +1192,11 @@ implementation
       else
         checkdef:=node.right.resultdef;
       { replace special types with their equivalent class type }
+      if (checkdef.typ=pointerdef) and
+         jvmimplicitpointertype(tpointerdef(checkdef).pointeddef) then
+        checkdef:=tpointerdef(checkdef).pointeddef;
       if checkdef=voidpointertype then
         checkdef:=java_jlobject
-      else if checkdef.typ=pointerdef then
-        checkdef:=tpointerdef(checkdef).pointeddef
       else if checkdef.typ=enumdef then
         checkdef:=tenumdef(checkdef).classdef
       else if checkdef.typ=setdef then