summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-06 14:28:37 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-06 14:28:37 +0000
commit55268a1d0a518334d2eb4d0edcc035be32a5608b (patch)
treef831afd9eaaba6484279a8d85ae815e15f6e848a
parent16eb5ce7ad5f14a1b3a524493a2125326d023b62 (diff)
downloadgcc-55268a1d0a518334d2eb4d0edcc035be32a5608b.tar.gz
* expr.c (pop_type_0): New function. (pop_type): Use pop_type_0. * java-tree.h (pop_type_0): New declaration. * verify.c (verify_jvm_instructions): Check return instructions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26217 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/expr.c22
-rw-r--r--gcc/java/java-tree.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 268861d68a4..8a7d0864f85 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -273,8 +273,12 @@ push_value (value)
}
}
+/* Pop a type from the type stack.
+ TYPE is the expected type. Return the actual type, which must be
+ convertible to TYPE, otherwise NULL_TREE is returned. */
+
tree
-pop_type (type)
+pop_type_0 (type)
tree type;
{
int n_words;
@@ -310,8 +314,22 @@ pop_type (type)
&& t == object_ptr_type_node)
return t;
}
+ return NULL_TREE;
+}
+
+/* Pop a type from the type stack.
+ TYPE is the expected type. Return the actual type, which must be
+ convertible to TYPE, otherwise call error. */
+
+tree
+pop_type (type)
+ tree type;
+{
+ tree t = pop_type_0 (type);
+ if (t != NULL_TREE)
+ return t;
error ("unexpected type on stack");
- return t;
+ return type;
}
/* Return 1f if SOURCE_TYPE can be safely widened to TARGET_TYPE.
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 9a1e9646f97..3158621f790 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -518,6 +518,7 @@ extern tree build_java_array_type PROTO ((tree, HOST_WIDE_INT));
extern int is_compiled_class PROTO ((tree));
extern tree mangled_classname PROTO ((const char*, tree));
extern tree lookup_label PROTO ((int));
+extern tree pop_type_0 PROTO ((tree));
extern tree pop_type PROTO ((tree));
extern void pop_argument_types PROTO ((tree));
extern tree decode_newarray_type PROTO ((int));