diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1999-04-06 07:28:37 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1999-04-06 07:28:37 -0700 |
commit | ddcd8199a816e1d7d6dba84ab77105ff423b4188 (patch) | |
tree | f831afd9eaaba6484279a8d85ae815e15f6e848a /gcc/java/expr.c | |
parent | b399dcd2cc8593440bb338e3e3ba04bc994e47a9 (diff) | |
download | gcc-ddcd8199a816e1d7d6dba84ab77105ff423b4188.zip gcc-ddcd8199a816e1d7d6dba84ab77105ff423b4188.tar.gz gcc-ddcd8199a816e1d7d6dba84ab77105ff423b4188.tar.bz2 |
expr.c (pop_type_0): New function.
�
* 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.
From-SVN: r26217
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r-- | gcc/java/expr.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 268861d..8a7d086 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. |