diff options
author | Bryce McKinlay <bryce@gcc.gnu.org> | 2005-04-06 18:42:23 +0100 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2005-04-06 18:42:23 +0100 |
commit | e3eff25ac18a36ff69e645befd92b88feae050a8 (patch) | |
tree | 64da2ef03a8adec3a64115e9d2837eeb5a836e68 | |
parent | 55b12f0d74eb9fa1e9da0f0848f9615c7c20a8a7 (diff) | |
download | gcc-e3eff25ac18a36ff69e645befd92b88feae050a8.zip gcc-e3eff25ac18a36ff69e645befd92b88feae050a8.tar.gz gcc-e3eff25ac18a36ff69e645befd92b88feae050a8.tar.bz2 |
natLogger.cc (getCallerStackFrame): Don't crash on NULL klass and meth values from _Jv_StackTrace::GetCallerInfo().
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().
From-SVN: r97739
-rw-r--r-- | libjava/ChangeLog | 1 | ||||
-rw-r--r-- | libjava/java/util/logging/natLogger.cc | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index c369ea5..9343748 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -43,7 +43,6 @@ Handle error cases. Added 'endp' argument. * include/jvm.h (_Jv_FindClassFromSignature): Updated prototype. ->>>>>>> 1.3459 2005-04-05 Tom Tromey <tromey@redhat.com> * Makefile.in: Rebuilt. diff --git a/libjava/java/util/logging/natLogger.cc b/libjava/java/util/logging/natLogger.cc index e92c487..5c68b17 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; } |