From ec806ad380c9756fb544d2adf1cff61be9b9320f Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 4 Feb 2010 14:45:08 +0000 Subject: Fix a bug when converting double and float types from NP variants to JNI types on V8 This bug has been present since the code was first added in V8Bindings/jni/jni_utility.cpp. https://android-git.corp.google.com/w/?p=platform/external/webkit.git;a=commitdiff;h=7fa30a60f66c19c8e6fb91ef799bca4d8d6f57f2 Change-Id: I4cc74369880d42e6610c2959f2d8bef2b7712927 --- WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'WebCore/bridge') diff --git a/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp b/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp index 2edb192..38f38f6 100644 --- a/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp +++ b/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp @@ -133,23 +133,29 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja case float_type: { +#if PLATFORM(ANDROID) + // TODO: Upstream this fix to webkit.org if (type == NPVariantType_Int32) - result.j = static_cast(NPVARIANT_TO_INT32(value)); + result.f = static_cast(NPVARIANT_TO_INT32(value)); else if (type == NPVariantType_Double) - result.j = static_cast(NPVARIANT_TO_DOUBLE(value)); + result.f = static_cast(NPVARIANT_TO_DOUBLE(value)); else bzero(&result, sizeof(jvalue)); +#endif } break; case double_type: { +#if PLATFORM(ANDROID) + // TODO: Upstream this fix to webkit.org if (type == NPVariantType_Int32) - result.j = static_cast(NPVARIANT_TO_INT32(value)); + result.d = static_cast(NPVARIANT_TO_INT32(value)); else if (type == NPVariantType_Double) - result.j = static_cast(NPVARIANT_TO_DOUBLE(value)); + result.d = static_cast(NPVARIANT_TO_DOUBLE(value)); else bzero(&result, sizeof(jvalue)); +#endif } break; -- cgit v1.1