aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index d65a6ff..8aa49ad 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