In sqlite3.wasm.allocFromTypedArray(), swap the order of the allocation and the access to the heap view object to work around an obscure issue when allocating huge blobs. The heap view object could previously become stale via the following allocation if the underlying WebAssembly.Memory object needed to grow. Essentially a realloc()-moves-the-pointer situation but it only comes up with huge allocations under the right circumstances and would trigger a JS exception (as opposed to corrupting the WASM heap). Problem reported in [forum:
05b77273be104532|forum post
05b77273be104532].
FossilOrigin-Name:
0f712b6b0516dc151d3bcbb63497661c82e11eae368e639bbdf197e1b3467195