diff options
author | Ben Elliston <bje@au.ibm.com> | 2006-02-03 11:56:58 +0000 |
---|---|---|
committer | Ben Elliston <bje@gcc.gnu.org> | 2006-02-03 22:56:58 +1100 |
commit | ab184b2a8fed51da5abc8af01a3258b9090f4aaf (patch) | |
tree | 40ce1ffcebc96077b6c41500950d3961b6d3e03e /gcc/java/jcf-parse.c | |
parent | 4a6c754b7a63dc27eda74622783b059029f85eb3 (diff) | |
download | gcc-ab184b2a8fed51da5abc8af01a3258b9090f4aaf.zip gcc-ab184b2a8fed51da5abc8af01a3258b9090f4aaf.tar.gz gcc-ab184b2a8fed51da5abc8af01a3258b9090f4aaf.tar.bz2 |
java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
* java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
* typeck.c: Likewise.
* verify-impl.c: Likewise.
* class.c: Likewise.
* decl.c: Likewise.
* jcf-parse.c: Likewise.
* constants.c: Likewise.
* check-init.c: Likewise.
* jcf-write.c: Likewise.
* verify-glue.c: Likewise.
* mangle.c: Likewise.
* expr.c: Likewise.
* lang.c: Likewise.
* boehm.c: Likewise.
From-SVN: r110541
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index dc33ccf..552c04a 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -120,7 +120,7 @@ handle_deprecated (void) else { /* Shouldn't happen. */ - abort (); + gcc_unreachable (); } } @@ -285,12 +285,12 @@ set_source_filename (JCF *jcf, int index) tree parse_signature (JCF *jcf, int sig_index) { - if (sig_index <= 0 || sig_index >= JPOOL_SIZE (jcf) - || JPOOL_TAG (jcf, sig_index) != CONSTANT_Utf8) - abort (); - else - return parse_signature_string (JPOOL_UTF_DATA (jcf, sig_index), - JPOOL_UTF_LENGTH (jcf, sig_index)); + gcc_assert (sig_index > 0 + && sig_index < JPOOL_SIZE (jcf) + && JPOOL_TAG (jcf, sig_index) == CONSTANT_Utf8); + + return parse_signature_string (JPOOL_UTF_DATA (jcf, sig_index), + JPOOL_UTF_LENGTH (jcf, sig_index)); } tree @@ -395,10 +395,7 @@ tree get_name_constant (JCF *jcf, int index) { tree name = get_constant (jcf, index); - - if (TREE_CODE (name) != IDENTIFIER_NODE) - abort (); - + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); return name; } @@ -445,10 +442,10 @@ handle_innerclass_attribute (int count, JCF *jcf) static tree give_name_to_class (JCF *jcf, int i) { - if (i <= 0 || i >= JPOOL_SIZE (jcf) - || JPOOL_TAG (jcf, i) != CONSTANT_Class) - abort (); - else + gcc_assert (i > 0 + && i < JPOOL_SIZE (jcf) + && JPOOL_TAG (jcf, i) == CONSTANT_Class); + { tree package_name = NULL_TREE, tmp; tree this_class; @@ -489,9 +486,9 @@ tree get_class_constant (JCF *jcf, int i) { tree type; - if (i <= 0 || i >= JPOOL_SIZE (jcf) - || (JPOOL_TAG (jcf, i) & ~CONSTANT_ResolvedFlag) != CONSTANT_Class) - abort (); + gcc_assert (i > 0 + && i < JPOOL_SIZE (jcf) + && (JPOOL_TAG (jcf, i) & ~CONSTANT_ResolvedFlag) == CONSTANT_Class); if (JPOOL_TAG (jcf, i) != CONSTANT_ResolvedClass) { @@ -1421,12 +1418,9 @@ parse_zip_file_entries (void) CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1; - if (TYPE_DUMMY (class)) - { - /* This is a dummy class, and now we're compiling it - for real. */ - abort (); - } + /* This is a dummy class, and now we're compiling it for + real. */ + gcc_assert (! TYPE_DUMMY (class)); /* This is for a corner case where we have a superclass but no superclass fields. @@ -1501,7 +1495,7 @@ parse_zip_file_entries (void) break; default: - abort (); + gcc_unreachable (); } } } |