summaryrefslogtreecommitdiff
path: root/libjava/java/util
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-06 17:42:23 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-06 17:42:23 +0000
commitcd5a68eee0a4148d2f43f8e259845f16ae3b54ff (patch)
tree64da2ef03a8adec3a64115e9d2837eeb5a836e68 /libjava/java/util
parent737b5433db287af159d307bea36b7e0d8f0d0f25 (diff)
downloadgcc-cd5a68eee0a4148d2f43f8e259845f16ae3b54ff.tar.gz
2005-04-06 Bryce McKinlay <mckinlay@redhat.com>
* java/util/logging/natLogger.cc (getCallerStackFrame): Don't crash on NULL klass and meth values from _Jv_StackTrace::GetCallerInfo(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util')
-rw-r--r--libjava/java/util/logging/natLogger.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libjava/java/util/logging/natLogger.cc b/libjava/java/util/logging/natLogger.cc
index e92c487c66f..5c68b1722c7 100644
--- a/libjava/java/util/logging/natLogger.cc
+++ b/libjava/java/util/logging/natLogger.cc
@@ -34,10 +34,16 @@ java::util::logging::Logger::getCallerStackFrame ()
_Jv_Method *meth = NULL;
_Jv_StackTrace::GetCallerInfo (&Logger::class$, &klass, &meth);
+ jstring meth_name = NULL;
+ jstring klass_name = NULL;
+ if (klass != NULL)
+ klass_name = klass->getName();
+ if (meth != NULL)
+ meth_name = _Jv_NewStringUtf8Const (meth->name);
+
java::lang::StackTraceElement *e
= new java::lang::StackTraceElement
- (JvNewStringUTF (""), 0,
- klass->getName(), _Jv_NewStringUtf8Const (meth->name), false);
+ (JvNewStringUTF (""), 0, klass_name, meth_name, false);
return e;
}