Fix several invalid uses of negative returns on acessing an array
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 16 Sep 2011 03:16:01 +0000 (23:16 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 16 Sep 2011 03:16:01 +0000 (23:16 -0400)
due to ase_optable_index
CID:87,88,109,110,111,114,115,116,117
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/ent/ent.c

index 08ad31b..eb9e407 100644 (file)
@@ -471,22 +471,19 @@ int ase_optable_index(Lisp_Object arg)
        case Lisp_Type_Record: {
                enum lrecord_type type =
                        XRECORD_LHEADER_IMPLEMENTATION(arg)->lrecord_type_index;
-
+               
                switch ((unsigned int)type) {
                case lrecord_type_marker:
                        return INT_T;
                case lrecord_type_dynacat:
-                       if (SYMBOLP(XDYNACAT_TYPE(arg))) {
-                               /* must be an dynacat */
-                               /* now we've got two options, either compute a
-                                * hash-value from the symbol's address
-                                * or store a cookie in the plist of the symbol
-                                * for the moment, we prefer the latter option
-                                */
-                               return ase_optable_index_typesym(
-                                       XDYNACAT_TYPE(arg));
-                       }
-                       break;
+                       assert(SYMBOLP(XDYNACAT_TYPE(arg)));
+                       /* must be an dynacat */
+                       /* now we've got two options, either compute a
+                        * hash-value from the symbol's address
+                        * or store a cookie in the plist of the symbol
+                        * for the moment, we prefer the latter option
+                        */
+                       return ase_optable_index_typesym(XDYNACAT_TYPE(arg));
                default:
                        return type;
                }
@@ -494,7 +491,7 @@ int ase_optable_index(Lisp_Object arg)
        default:
                return INT_T;
        }
-       return -1;
+       return -1; /* Should not reach here */
 }
 
 int