From 8f0960834317f5a64a9246b0321b5f90f9faaf05 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 9 Sep 2005 16:04:11 +0000 Subject: [PATCH] re PR libgcj/23182 (instanceof sometimes fails if compiled with -findirect-dispatch) 2005-09-09 Andrew Haley PR libgcj/23182 * expr.c (pop_type_0): If the expected type is object or ptr (i.e. void*), return the type of the object we just popped from the stack. From-SVN: r104098 --- gcc/java/ChangeLog | 7 +++++++ gcc/java/expr.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 81fc91373f6..ed9655338eb 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2005-09-09 Andrew Haley + + PR libgcj/23182 + * expr.c (pop_type_0): If the expected type is object or ptr + (i.e. void*), return the type of the object we just popped from + the stack. + 2005-09-06 Andrew Pinski * java-gimplify.c (java_gimplify_block): NULL out the old BLOCK's diff --git a/gcc/java/expr.c b/gcc/java/expr.c index d65a6ff563c..8aa49ada40f 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -350,6 +350,11 @@ pop_type_0 (tree type, char **messagep) return t; if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (t) == POINTER_TYPE) { + /* If the expected type we've been passed is object or ptr + (i.e. void*), the caller needs to know the real type. */ + if (type == ptr_type_node || type == object_ptr_type_node) + return t; + /* Since the verifier has already run, we know that any types we see will be compatible. In BC mode, this fact may be checked at runtime, but if that is so then we can -- 2.30.2