You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/09/27 08:02:06 UTC

[GitHub] YorkShen closed pull request #1589: [core][Android] fix NPE and decode error in opcode

YorkShen closed pull request #1589: [core][Android] fix NPE and decode error in opcode
URL: https://github.com/apache/incubator-weex/pull/1589
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index 32a96123ff..50b21f87af 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -2948,14 +2948,14 @@ public void setStyleHeight(String instanceId, String ref, float value) {
     if (isJSFrameworkInit()) {
       return mWXBridge.getFirstScreenRenderTime(instanceId);
     }
-    return null;
+    return new long[]{0, 0, 0};
   }
 
   public long[] getRenderFinishTime(String instanceId) {
     if (isJSFrameworkInit()) {
       return mWXBridge.getRenderFinishTime(instanceId);
     }
-    return null;
+    return new long[]{0, 0, 0};
   }
 
   public void setMargin(String instanceId, String ref, CSSShorthand.EDGE edge, float value) {
diff --git a/weex_core/Source/core/data_render/exec_state.cc b/weex_core/Source/core/data_render/exec_state.cc
index 9ea9a045de..ae567ca65c 100644
--- a/weex_core/Source/core/data_render/exec_state.cc
+++ b/weex_core/Source/core/data_render/exec_state.cc
@@ -686,7 +686,7 @@ void ExecState::decodeGlobalVariableSection() {
         }
 
         long value;
-        file->read((char*)&value, sizeof(long));
+        file->read((char*)&value, sizeof(int64_t));
         global_variables_.insert(std::pair<std::string, long>(key, value));
     }
 }
@@ -761,7 +761,7 @@ void ExecState::decodeRefSection() {
         Value value;
         decodeValue(value);
         long register_id;
-        file->read((char*)&register_id, sizeof(long));
+        file->read((char*)&register_id, sizeof(int64_t));
         ValueRef *ref = new ValueRef(nullptr, register_id);
         ref->func_index_ = value.index;
         decodeValue(ref->value_);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services