]> git.bitcoin.ninja Git - ldk-java/commitdiff
[TS] Correct pointer arithmetic on array construction
authorMatt Corallo <git@bluematt.me>
Mon, 10 Jan 2022 03:07:49 +0000 (03:07 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 10 Jan 2022 05:04:36 +0000 (05:04 +0000)
typescript_strings.py

index a12370f4e2b78cc47c8d5836da8d34fc5a2b8d2b..a24faea79921544862ace4fe6efe14f0911812f1 100644 (file)
@@ -336,8 +336,8 @@ import * as InternalUtils from '../InternalUtils.mjs'
         assert False # Only called if above is None
     def get_native_arr_ptr_call(self, ty_info):
         if ty_info.subty is not None:
-            return "(" + ty_info.subty.c_ty + "*)(", " + 4)"
-        return "(" + ty_info.c_ty + "*)(", " + 4)"
+            return "(" + ty_info.subty.c_ty + "*)(((uint8_t*)", ") + 4)"
+        return "(" + ty_info.c_ty + "*)(((uint8_t*)", ") + 4)"
     def get_native_arr_entry_call(self, ty_info, arr_name, idxc, entry_access):
         return None
     def cleanup_native_arr_ref_contents(self, arr_name, dest_name, arr_len, ty_info):