harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r507992 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
Date Thu, 15 Feb 2007 16:34:29 GMT
Author: gshimansky
Date: Thu Feb 15 08:34:27 2007
New Revision: 507992

URL: http://svn.apache.org/viewvc?view=rev&rev=507992
Log:
Applied HARMONY-3174 [drlvm][classloader] specjv98 tests failed due to wrong class file format
checks. -- improved patch

Tests passed on Ubuntu6 x86, Windows XP x86, SuSE9 x86_64 and SuSE9 IPF


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp?view=diff&rev=507992&r1=507991&r2=507992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp Thu Feb
15 08:34:27 2007
@@ -615,45 +615,35 @@
 static bool
 is_identifier(const char *name, unsigned len)
 {
-    uint32 u_ch;    
-    for(unsigned i = 0; i < len; i++) {
+    uint32 u_ch;
+    for(unsigned i = 0; i < len;) {
+        unsigned ch_len = 0;
         if(name[i] & 0x80) {
             assert(name[i] & 0x40);
             if(name[i] & 0x20) {
                 uint32 x = name[i];
-                i++;
-                uint32 y = name[i];
-                i++;
-                uint32 z = name[i];
+                uint32 y = name[i + 1];
+                uint32 z = name[i + 2];
                 u_ch = (uint32)(((0x0f & x) << 12) + ((0x3f & y) << 6)
+ ((0x3f & z)));
-                if(i == 2) {
-                    if(!(u_isalpha(u_ch) || u_ch == '$' ||  u_ch == '_'))
-                        return false;
-                } else {
-                    if(!(u_isalnum(u_ch) || u_ch == '$' ||  u_ch == '_'))
-                        return false;
-                }        
+                ch_len = 3;
             } else {
                 uint32 x = name[i];
-                i++;
-                uint32 y = name[i];
+                uint32 y = name[i + 1];
                 u_ch = (uint32)(((0x1f & x) << 6) + (0x3f & y));
-                if(i == 1) {
-                    if(!(u_isalpha(u_ch) || u_ch == '$' ||  u_ch == '_'))
-                        return false;                    
-                }
-                if(!(u_isalnum(u_ch) || u_ch == '$' ||  u_ch == '_'))
-                    return false;
+                ch_len = 2;
             }
         } else {
             u_ch = name[i];
-            if(i == 0) {
-                if(!(u_isalpha(u_ch) || u_ch == '$' ||  u_ch == '_'))
-                    return false;                
-            }
+            ch_len = 1;
+        }
+        if(i == 0) {
+            if(!(u_isalpha(u_ch) || u_ch == '$' ||  u_ch == '_'))
+                return false;                
+        } else {
             if(!(u_isalnum(u_ch) || u_ch == '$' ||  u_ch == '_'))
                 return false;
-        }
+        }    
+        i += ch_len;
     }
     return true;
 }
@@ -679,6 +669,7 @@
             case '>':
                 if(is_method)
                     return false;
+                break;    
             }
         }
     }



Mime
View raw message