From c4a7eff125894d6c1bf18dec34c439f5dec4c2c5 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 10 Jan 2022 03:07:49 +0000 Subject: [PATCH] [TS] Correct pointer arithmetic on array construction --- typescript_strings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript_strings.py b/typescript_strings.py index a12370f4..a24faea7 100644 --- a/typescript_strings.py +++ b/typescript_strings.py @@ -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): -- 2.39.5