PatchSet 4413 
Date: 2004/02/11 17:23:48
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Replaced macro by static inline function

2004-02-11  Dalibor Topic <[EMAIL PROTECTED]>

        * kaffe/kaffevm/verify.c
        (poolError): New static inline function.
        (POOLERROR): Removed.
        (verify2) Use poolError instead of POOLERROR macro.

Members: 
        ChangeLog:1.1996->1.1997 
        kaffe/kaffevm/verify.c:1.30->1.31 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1996 kaffe/ChangeLog:1.1997
--- kaffe/ChangeLog:1.1996      Tue Feb 10 17:21:58 2004
+++ kaffe/ChangeLog     Wed Feb 11 17:23:48 2004
@@ -1,3 +1,10 @@
+2004-02-11  Dalibor Topic <[EMAIL PROTECTED]>
+
+       * kaffe/kaffevm/verify.c
+       (poolError): New static inline function.
+       (POOLERROR): Removed.
+       (verify2) Use poolError instead of POOLERROR macro.
+
 2004-02-10  Dalibor Topic <[EMAIL PROTECTED]>
 
        * config/m68k/jit3-m68k.def:
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.30 kaffe/kaffe/kaffevm/verify.c:1.31
--- kaffe/kaffe/kaffevm/verify.c:1.30   Sun Feb  8 17:11:38 2004
+++ kaffe/kaffe/kaffevm/verify.c        Wed Feb 11 17:23:50 2004
@@ -305,6 +305,15 @@
 #endif /* !(defined(NDEBUG) || !defined(KAFFE_VMDEBUG)) */
 
 
+/* Helper function for pool errors */
+static inline
+bool
+poolError(Hjava_lang_Class* class, errorInfo *einfo)
+{
+       postExceptionMessage(einfo, JAVA_LANG(ClassFormatError), "malformed constant 
pool in class \"%s\"", CLASS_CNAME(class));
+       return (false);
+}
+
 /*
  * Verify pass 2:  Check the internal consistency of the class file
  *  but do not check the bytecode.  If at any point we find an error in the
@@ -515,11 +524,7 @@
         * under Transvirtual, though even this has been modified.
         *********************************************************/
        /* error message for step 3 */
-#define POOLERROR \
-       postExceptionMessage(einfo, JAVA_LANG(ClassFormatError), "malformed constant 
pool in class \"%s\"", CLASS_CNAME(class)); \
-       return (false)
-       
-       
+               
        pool = CLASS_CONSTANTS(class);
        
         /* Constant pool loaded - check it's integrity. */
@@ -530,19 +535,19 @@
                case CONSTANT_InterfaceMethodref:
                        tag = CONST_TAG(FIELDREF_CLASS(idx, pool), pool);
                        if (tag != CONSTANT_Class && tag != CONSTANT_ResolvedClass) {
-                               POOLERROR;
+                               return poolError(class, einfo);
                        }
                        if (CONST_TAG(FIELDREF_NAMEANDTYPE(idx, pool), pool) != 
CONSTANT_NameAndType) {
-                               POOLERROR;
+                               return poolError(class, einfo);
                        }
                        break;
                        
                case CONSTANT_NameAndType:
                        if (CONST_TAG(NAMEANDTYPE_NAME(idx, pool), pool) != 
CONSTANT_Utf8) {
-                               POOLERROR;
+                               return poolError(class, einfo);
                        }
                        if (CONST_TAG(NAMEANDTYPE_SIGNATURE(idx, pool), pool) != 
CONSTANT_Utf8) {
-                               POOLERROR;
+                               return poolError(class, einfo);
                        }
                        break;
                        
@@ -572,11 +577,11 @@
                        
                default:
                        /* undefined tag */
-                       POOLERROR;
+                       return poolError(class, einfo);
                        break;
                }
        }
-#undef POOLERROR       
+
        DBG(VERIFY2, printConstantPool(class));
 
        

_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to