[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:20:09 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e0081e42706a721ec690c75a1360bced4fbf6e3b
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 19 21:55:27 2003 +0000
Fixed 3515597. When an error occurs we need
to make sure result values are zeroed.
Cleaned up logs by adding a newline.
Reviewed by John.
* bindings/jni/jni_utility.cpp:
(KJS::Bindings::getJavaVM):
(KJS::Bindings::getJNIEnv):
(callJNIMethod):
(callJNIMethodA):
(KJS::Bindings::getJNIField):
* bindings/jni_jsobject.cpp:
(JSObject::convertValueToJObject):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index e7c02d6..5d52839 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,21 @@
+2003-12-19 Richard Williamson <rjw at apple.com>
+
+ Fixed 3515597. When an error occurs we need
+ to make sure result values are zeroed.
+
+ Cleaned up logs by adding a newline.
+
+ Reviewed by John.
+
+ * bindings/jni/jni_utility.cpp:
+ (KJS::Bindings::getJavaVM):
+ (KJS::Bindings::getJNIEnv):
+ (callJNIMethod):
+ (callJNIMethodA):
+ (KJS::Bindings::getJNIField):
+ * bindings/jni_jsobject.cpp:
+ (JSObject::convertValueToJObject):
+
=== Safari-119 ===
2003-12-17 Richard Williamson <rjw at apple.com>
diff --git a/JavaScriptCore/bindings/jni/jni_utility.cpp b/JavaScriptCore/bindings/jni/jni_utility.cpp
index 16a2b50..3ef01f1 100644
--- a/JavaScriptCore/bindings/jni/jni_utility.cpp
+++ b/JavaScriptCore/bindings/jni/jni_utility.cpp
@@ -32,7 +32,7 @@
using namespace KJS::Bindings;
-static JavaVM *jvm;
+static JavaVM *jvm = 0;
JavaVM *KJS::Bindings::getJavaVM()
{
@@ -50,7 +50,7 @@ JavaVM *KJS::Bindings::getJavaVM()
jvm = jvmArray[0];
}
else
- fprintf(stderr, "%s: JNI_GetCreatedJavaVMs failed, returned %d", __PRETTY_FUNCTION__, jniError);
+ fprintf(stderr, "%s: JNI_GetCreatedJavaVMs failed, returned %d\n", __PRETTY_FUNCTION__, jniError);
return jvm;
}
@@ -64,7 +64,7 @@ JNIEnv *KJS::Bindings::getJNIEnv()
if ( jniError == JNI_OK )
return env;
else
- fprintf(stderr, "%s: AttachCurrentThread failed, returned %d", __PRETTY_FUNCTION__, jniError);
+ fprintf(stderr, "%s: AttachCurrentThread failed, returned %d\n", __PRETTY_FUNCTION__, jniError);
return NULL;
}
@@ -74,6 +74,7 @@ static jvalue callJNIMethod( JNIType type, jobject obj, const char *name, const
JNIEnv *env = getJNIEnv();
jvalue result;
+ bzero (&result, sizeof(jvalue));
if ( obj != NULL && jvm != NULL && env != NULL) {
jclass cls = env->GetObjectClass(obj);
if ( cls != NULL ) {
@@ -112,12 +113,12 @@ static jvalue callJNIMethod( JNIType type, jobject obj, const char *name, const
result.d = env->functions->CallDoubleMethodV(env, obj, mid, args);
break;
default:
- fprintf(stderr, "%s: invalid function type (%d)", __PRETTY_FUNCTION__, (int)type);
+ fprintf(stderr, "%s: invalid function type (%d)\n", __PRETTY_FUNCTION__, (int)type);
}
}
else
{
- fprintf(stderr, "%s: Could not find method: %s!", __PRETTY_FUNCTION__, name);
+ fprintf(stderr, "%s: Could not find method: %s\n", __PRETTY_FUNCTION__, name);
env->ExceptionDescribe();
env->ExceptionClear();
}
@@ -125,7 +126,7 @@ static jvalue callJNIMethod( JNIType type, jobject obj, const char *name, const
env->DeleteLocalRef(cls);
}
else {
- fprintf(stderr, "%s: Could not find class for object!", __PRETTY_FUNCTION__);
+ fprintf(stderr, "%s: Could not find class for object\n", __PRETTY_FUNCTION__);
}
}
@@ -138,6 +139,7 @@ static jvalue callJNIMethodA( JNIType type, jobject obj, const char *name, const
JNIEnv *env = getJNIEnv();
jvalue result;
+ bzero (&result, sizeof(jvalue));
if ( obj != NULL && jvm != NULL && env != NULL) {
jclass cls = env->GetObjectClass(obj);
if ( cls != NULL ) {
@@ -176,12 +178,12 @@ static jvalue callJNIMethodA( JNIType type, jobject obj, const char *name, const
result.d = env->functions->CallDoubleMethodA(env, obj, mid, args);
break;
default:
- fprintf(stderr, "%s: invalid function type (%d)", __PRETTY_FUNCTION__, (int)type);
+ fprintf(stderr, "%s: invalid function type (%d)\n", __PRETTY_FUNCTION__, (int)type);
}
}
else
{
- fprintf(stderr, "%s: Could not find method: %s!", __PRETTY_FUNCTION__, name);
+ fprintf(stderr, "%s: Could not find method: %s\n", __PRETTY_FUNCTION__, name);
env->ExceptionDescribe();
env->ExceptionClear();
}
@@ -189,7 +191,7 @@ static jvalue callJNIMethodA( JNIType type, jobject obj, const char *name, const
env->DeleteLocalRef(cls);
}
else {
- fprintf(stderr, "%s: Could not find class for object!", __PRETTY_FUNCTION__);
+ fprintf(stderr, "%s: Could not find class for object\n", __PRETTY_FUNCTION__);
}
}
@@ -478,6 +480,7 @@ jvalue KJS::Bindings::getJNIField( jobject obj, JNIType type, const char *name,
JNIEnv *env = getJNIEnv();
jvalue result;
+ bzero (&result, sizeof(jvalue));
if ( obj != NULL && jvm != NULL && env != NULL) {
jclass cls = env->GetObjectClass(obj);
if ( cls != NULL ) {
@@ -512,12 +515,12 @@ jvalue KJS::Bindings::getJNIField( jobject obj, JNIType type, const char *name,
result.d = env->functions->GetDoubleField(env, obj, field);
break;
default:
- fprintf(stderr, "%s: invalid field type (%d)", __PRETTY_FUNCTION__, (int)type);
+ fprintf(stderr, "%s: invalid field type (%d)\n", __PRETTY_FUNCTION__, (int)type);
}
}
else
{
- fprintf(stderr, "%s: Could not find field: %s!", __PRETTY_FUNCTION__, name);
+ fprintf(stderr, "%s: Could not find field: %s\n", __PRETTY_FUNCTION__, name);
env->ExceptionDescribe();
env->ExceptionClear();
}
@@ -525,7 +528,7 @@ jvalue KJS::Bindings::getJNIField( jobject obj, JNIType type, const char *name,
env->DeleteLocalRef(cls);
}
else {
- fprintf(stderr, "%s: Could not find class for object!", __PRETTY_FUNCTION__);
+ fprintf(stderr, "%s: Could not find class for object\n", __PRETTY_FUNCTION__);
}
}
diff --git a/JavaScriptCore/bindings/jni_jsobject.cpp b/JavaScriptCore/bindings/jni_jsobject.cpp
index e906f55..c7297eb 100644
--- a/JavaScriptCore/bindings/jni_jsobject.cpp
+++ b/JavaScriptCore/bindings/jni_jsobject.cpp
@@ -603,7 +603,7 @@ jobject JSObject::convertValueToJObject (KJS::Value value) const
// object. If we have a wrapper around a Java instance, return that
// instance, otherwise create a new Java JSObject with the ObjectImp*
// as it's nativeHandle.
- if (strcmp(imp->classInfo()->className, "RuntimeObject") == 0) {
+ if (imp->classInfo() && strcmp(imp->classInfo()->className, "RuntimeObject") == 0) {
KJS::RuntimeObjectImp *runtimeImp = static_cast<KJS::RuntimeObjectImp*>(value.imp());
Bindings::JavaInstance *runtimeInstance = static_cast<Bindings::JavaInstance *>(runtimeImp->getInternalInstance());
return runtimeInstance->javaInstance();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list