[llvm-commits] CVS: llvm-java/lib/ClassFile/ClassFile.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Thu May 27 14:41:01 PDT 2004


Changes in directory llvm-java/lib/ClassFile:

ClassFile.cpp updated: 1.9 -> 1.10

---
Log message:

Fix constant pool parsing. Doubles and longs take two slots in the
constant pool (yuck).


---
Diffs of the changes:  (+4 -2)

Index: llvm-java/lib/ClassFile/ClassFile.cpp
diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.9 llvm-java/lib/ClassFile/ClassFile.cpp:1.10
--- llvm-java/lib/ClassFile/ClassFile.cpp:1.9	Sat May 22 00:57:09 2004
+++ llvm-java/lib/ClassFile/ClassFile.cpp	Thu May 27 14:37:27 2004
@@ -66,9 +66,11 @@
         uint16_t count = readU2(is);
         cp.reserve(count);
         cp.push_back(NULL);
-        --count;
-        while (count--)
+        while (cp.size() < count) {
             cp.push_back(Constant::readConstant(cp, is));
+            if (cp.back()->isDoubleSlot())
+                cp.push_back(NULL);
+        }
     }
 
     void readClasses(Classes& i, const ConstantPool& cp, std::istream& is)





More information about the llvm-commits mailing list