diff options
author | Steve Block <steveblock@google.com> | 2010-02-04 14:45:08 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 14:45:08 +0000 |
commit | ec806ad380c9756fb544d2adf1cff61be9b9320f (patch) | |
tree | 68e62775968b318839171ce25769bf0545d13f9f /WebCore/bridge | |
parent | d7a7a76b919b1d8bdca7fe04a45594c3bccb1dde (diff) | |
download | external_webkit-ec806ad380c9756fb544d2adf1cff61be9b9320f.zip external_webkit-ec806ad380c9756fb544d2adf1cff61be9b9320f.tar.gz external_webkit-ec806ad380c9756fb544d2adf1cff61be9b9320f.tar.bz2 |
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
Diffstat (limited to 'WebCore/bridge')
-rw-r--r-- | WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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<jfloat>(NPVARIANT_TO_INT32(value)); + result.f = static_cast<jfloat>(NPVARIANT_TO_INT32(value)); else if (type == NPVariantType_Double) - result.j = static_cast<jfloat>(NPVARIANT_TO_DOUBLE(value)); + result.f = static_cast<jfloat>(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<jdouble>(NPVARIANT_TO_INT32(value)); + result.d = static_cast<jdouble>(NPVARIANT_TO_INT32(value)); else if (type == NPVariantType_Double) - result.j = static_cast<jdouble>(NPVARIANT_TO_DOUBLE(value)); + result.d = static_cast<jdouble>(NPVARIANT_TO_DOUBLE(value)); else bzero(&result, sizeof(jvalue)); +#endif } break; |