[llvm-commits] CVS: llvm-java/lib/ClassFile/ClassFile.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue Jul 13 01:57:19 PDT 2004
Changes in directory llvm-java/lib/ClassFile:
ClassFile.cpp updated: 1.14 -> 1.15
---
Log message:
If the catchType index of the exception is 0, then this is a catch all
block.
---
Diffs of the changes: (+13 -6)
Index: llvm-java/lib/ClassFile/ClassFile.cpp
diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.14 llvm-java/lib/ClassFile/ClassFile.cpp:1.15
--- llvm-java/lib/ClassFile/ClassFile.cpp:1.14 Thu Jul 8 19:00:26 2004
+++ llvm-java/lib/ClassFile/ClassFile.cpp Tue Jul 13 03:57:09 2004
@@ -660,20 +660,27 @@
CodeAttribute::Exception::Exception(const ConstantPool& cp,
std::istream& is)
+ : catchType_(NULL)
{
startPc_ = readU2(is);
endPc_ = readU2(is);
handlerPc_ = readU2(is);
- catchType_ = dynamic_cast<ConstantClass*>(cp[readU2(is)]);
- if (!catchType_)
- throw ClassFileSemanticError(
- "Representation of catch type is not of type ConstantClass");
+ uint16_t idx = readU2(is);
+ if (idx) {
+ catchType_ = dynamic_cast<ConstantClass*>(cp[idx]);
+ if (!catchType_)
+ throw ClassFileSemanticError
+ ("Representation of catch type is not of type ConstantClass");
+ }
}
std::ostream& CodeAttribute::Exception::dump(std::ostream& os) const
{
- return os << *getCatchType() << '\n'
- << "Start PC: " << startPc_ << '\n'
+ if (getCatchType())
+ os << *getCatchType() << '\n';
+ else
+ os << "catch-all\n";
+ return os << "Start PC: " << startPc_ << '\n'
<< "End PC: " << endPc_ << '\n'
<< "Handler PC: " << handlerPc_;
}
More information about the llvm-commits
mailing list