summaryrefslogtreecommitdiffstats
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1998-11-14 17:22:22 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1998-11-14 17:22:22 +0000
commit3ce9bac01727a97c67b7f83df37b9301d7f65b6e (patch)
treec372fadfdc48e2a6b988a0d96a60b47f714f4b8d /gcc/java/expr.c
parent94c0ab0c83aa0aece098c5ed05a1bbc055dc4b3d (diff)
downloadppe42-gcc-3ce9bac01727a97c67b7f83df37b9301d7f65b6e.tar.gz
ppe42-gcc-3ce9bac01727a97c67b7f83df37b9301d7f65b6e.zip
Allow uses of interface types to verify. This is not really type-safe, but it matches what Sun does, and is OK as long as there are appropriate run-time checks. * verify.c (merge_types): If merging two interface types, just set the result to java.lang.Object. * expr.c (pop_type): Any interface is matches by java.lang.Object. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23656 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 0df6106bcaa..9bd1ca7430c 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -268,6 +268,12 @@ pop_type (type)
return type;
else if (can_widen_reference_to (t, type))
return t;
+ /* This is a kludge, but matches what Sun's verifier does.
+ It can be tricked, but is safe as long as type errors
+ (i.e. interface method calls) are caught at run-time. */
+ else if (CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (type)))
+ && t == object_ptr_type_node)
+ return t;
}
error ("unexpected type on stack");
return t;
OpenPOWER on IntegriCloud