From 81f809f2a675ff4ff7f93231ca87a18cb5b4628e Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 16 Aug 2019 11:05:24 -0400 Subject: Revert "Remove dead code: legacy read/write ops" This is causing a segfault for unknown reasons - see #2787. This reverts commit 498f6ad431478f655b136782093e19e29248b24d. --- js/dispatch.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'js/dispatch.ts') diff --git a/js/dispatch.ts b/js/dispatch.ts index 6edd2981c..babea5739 100644 --- a/js/dispatch.ts +++ b/js/dispatch.ts @@ -32,13 +32,9 @@ function flatbufferRecordFromBuf(buf: Uint8Array): FlatbufferRecord { } export function handleAsyncMsgFromRust(opId: number, ui8: Uint8Array): void { + const buf32 = new Int32Array(ui8.buffer, ui8.byteOffset, ui8.byteLength / 4); if (opId !== FLATBUFFER_OP_ID) { // Fast and new - const buf32 = new Int32Array( - ui8.buffer, - ui8.byteOffset, - ui8.byteLength / 4 - ); const recordMin = recordFromBufMinimal(opId, buf32); handleAsyncMsgFromRustMinimal(ui8, recordMin); } else { -- cgit v1.2.3