sql.js 1.10.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1878,10 +1878,10 @@ function writeStackCookie() {
1878
1878
  // The stack grow downwards towards _emscripten_stack_get_end.
1879
1879
  // We write cookies to the final two words in the stack and detect if they are
1880
1880
  // ever overwritten.
1881
- HEAPU32[((max)>>2)] = 0x02135467;
1882
- HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE;
1881
+ HEAPU32[((max)>>2)] = 0x02135467;checkInt32(0x02135467);
1882
+ HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE;checkInt32(0x89BACDFE);
1883
1883
  // Also test the global address 0 for integrity.
1884
- HEAPU32[((0)>>2)] = 1668509029;
1884
+ HEAPU32[((0)>>2)] = 1668509029;checkInt32(1668509029);
1885
1885
  }
1886
1886
 
1887
1887
  function checkStackCookie() {
@@ -1935,6 +1935,8 @@ function initRuntime() {
1935
1935
 
1936
1936
  checkStackCookie();
1937
1937
 
1938
+ setStackLimits();
1939
+
1938
1940
 
1939
1941
  if (!Module["noFSInit"] && !FS.init.initialized)
1940
1942
  FS.init();
@@ -2394,6 +2396,31 @@ function unexportedRuntimeSymbol(sym) {
2394
2396
  }
2395
2397
  }
2396
2398
 
2399
+ var MAX_UINT8 = (2 ** 8) - 1;
2400
+ var MAX_UINT16 = (2 ** 16) - 1;
2401
+ var MAX_UINT32 = (2 ** 32) - 1;
2402
+ var MAX_UINT53 = (2 ** 53) - 1;
2403
+ var MAX_UINT64 = (2 ** 64) - 1;
2404
+
2405
+ var MIN_INT8 = - (2 ** ( 8 - 1)) + 1;
2406
+ var MIN_INT16 = - (2 ** (16 - 1)) + 1;
2407
+ var MIN_INT32 = - (2 ** (32 - 1)) + 1;
2408
+ var MIN_INT53 = - (2 ** (53 - 1)) + 1;
2409
+ var MIN_INT64 = - (2 ** (64 - 1)) + 1;
2410
+
2411
+ function checkInt(value, bits, min, max) {
2412
+ assert(Number.isInteger(Number(value)), `attempt to write non-integer (${value}) into integer heap`);
2413
+ assert(value <= max, `value (${value}) too large to write as ${bits}-bit value`);
2414
+ assert(value >= min, `value (${value}) too small to write as ${bits}-bit value`);
2415
+ }
2416
+
2417
+ var checkInt1 = (value) => checkInt(value, 1, 1);
2418
+ var checkInt8 = (value) => checkInt(value, 8, MIN_INT8, MAX_UINT8);
2419
+ var checkInt16 = (value) => checkInt(value, 16, MIN_INT16, MAX_UINT16);
2420
+ var checkInt32 = (value) => checkInt(value, 32, MIN_INT32, MAX_UINT32);
2421
+ var checkInt53 = (value) => checkInt(value, 53, MIN_INT53, MAX_UINT53);
2422
+ var checkInt64 = (value) => checkInt(value, 64, MIN_INT64, MAX_UINT64);
2423
+
2397
2424
  // Used by XXXXX_DEBUG settings to output debug messages.
2398
2425
  function dbg(text) {
2399
2426
  // TODO(sbc): Make this configurable somehow. Its not always convenient for
@@ -2448,6 +2475,12 @@ function dbg(text) {
2448
2475
  return '0x' + ptr.toString(16).padStart(8, '0');
2449
2476
  };
2450
2477
 
2478
+ var setStackLimits = () => {
2479
+ var stackLow = _emscripten_stack_get_base();
2480
+ var stackHigh = _emscripten_stack_get_end();
2481
+ ___set_stack_limits(stackLow, stackHigh);
2482
+ };
2483
+
2451
2484
 
2452
2485
  /**
2453
2486
  * @param {number} ptr
@@ -2457,10 +2490,10 @@ function dbg(text) {
2457
2490
  function setValue(ptr, value, type = 'i8') {
2458
2491
  if (type.endsWith('*')) type = '*';
2459
2492
  switch (type) {
2460
- case 'i1': HEAP8[((ptr)>>0)] = value; break;
2461
- case 'i8': HEAP8[((ptr)>>0)] = value; break;
2462
- case 'i16': HEAP16[((ptr)>>1)] = value; break;
2463
- case 'i32': HEAP32[((ptr)>>2)] = value; break;
2493
+ case 'i1': HEAP8[((ptr)>>0)] = value;checkInt8(value); break;
2494
+ case 'i8': HEAP8[((ptr)>>0)] = value;checkInt8(value); break;
2495
+ case 'i16': HEAP16[((ptr)>>1)] = value;checkInt16(value); break;
2496
+ case 'i32': HEAP32[((ptr)>>2)] = value;checkInt32(value); break;
2464
2497
  case 'i64': abort('to do setValue(i64) use WASM_BIGINT');
2465
2498
  case 'float': HEAPF32[((ptr)>>2)] = value; break;
2466
2499
  case 'double': HEAPF64[((ptr)>>3)] = value; break;
@@ -2555,6 +2588,16 @@ function dbg(text) {
2555
2588
  abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
2556
2589
  };
2557
2590
 
2591
+
2592
+
2593
+ var ___handle_stack_overflow = (requested) => {
2594
+ var base = _emscripten_stack_get_base();
2595
+ var end = _emscripten_stack_get_end();
2596
+ abort(`stack overflow (Attempt to set SP to ${ptrToString(requested)}` +
2597
+ `, with stack limits [${ptrToString(end)} - ${ptrToString(base)}` +
2598
+ ']). If you require more stack space build with -sSTACK_SIZE=<bytes>');
2599
+ };
2600
+
2558
2601
  var PATH = {
2559
2602
  isAbs:(path) => path.charAt(0) === '/',
2560
2603
  splitPath:(filename) => {
@@ -5307,25 +5350,25 @@ function dbg(text) {
5307
5350
  }
5308
5351
  throw e;
5309
5352
  }
5310
- HEAP32[((buf)>>2)] = stat.dev;
5311
- HEAP32[(((buf)+(4))>>2)] = stat.mode;
5312
- HEAPU32[(((buf)+(8))>>2)] = stat.nlink;
5313
- HEAP32[(((buf)+(12))>>2)] = stat.uid;
5314
- HEAP32[(((buf)+(16))>>2)] = stat.gid;
5315
- HEAP32[(((buf)+(20))>>2)] = stat.rdev;
5316
- (tempI64 = [stat.size>>>0,(tempDouble = stat.size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(24))>>2)] = tempI64[0],HEAP32[(((buf)+(28))>>2)] = tempI64[1]);
5317
- HEAP32[(((buf)+(32))>>2)] = 4096;
5318
- HEAP32[(((buf)+(36))>>2)] = stat.blocks;
5353
+ HEAP32[((buf)>>2)] = stat.dev;checkInt32(stat.dev);
5354
+ HEAP32[(((buf)+(4))>>2)] = stat.mode;checkInt32(stat.mode);
5355
+ HEAPU32[(((buf)+(8))>>2)] = stat.nlink;checkInt32(stat.nlink);
5356
+ HEAP32[(((buf)+(12))>>2)] = stat.uid;checkInt32(stat.uid);
5357
+ HEAP32[(((buf)+(16))>>2)] = stat.gid;checkInt32(stat.gid);
5358
+ HEAP32[(((buf)+(20))>>2)] = stat.rdev;checkInt32(stat.rdev);
5359
+ (tempI64 = [stat.size>>>0,(tempDouble = stat.size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(24))>>2)] = tempI64[0],HEAP32[(((buf)+(28))>>2)] = tempI64[1]);checkInt64(stat.size);
5360
+ HEAP32[(((buf)+(32))>>2)] = 4096;checkInt32(4096);
5361
+ HEAP32[(((buf)+(36))>>2)] = stat.blocks;checkInt32(stat.blocks);
5319
5362
  var atime = stat.atime.getTime();
5320
5363
  var mtime = stat.mtime.getTime();
5321
5364
  var ctime = stat.ctime.getTime();
5322
- (tempI64 = [Math.floor(atime / 1000)>>>0,(tempDouble = Math.floor(atime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(40))>>2)] = tempI64[0],HEAP32[(((buf)+(44))>>2)] = tempI64[1]);
5323
- HEAPU32[(((buf)+(48))>>2)] = (atime % 1000) * 1000;
5324
- (tempI64 = [Math.floor(mtime / 1000)>>>0,(tempDouble = Math.floor(mtime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(56))>>2)] = tempI64[0],HEAP32[(((buf)+(60))>>2)] = tempI64[1]);
5325
- HEAPU32[(((buf)+(64))>>2)] = (mtime % 1000) * 1000;
5326
- (tempI64 = [Math.floor(ctime / 1000)>>>0,(tempDouble = Math.floor(ctime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(72))>>2)] = tempI64[0],HEAP32[(((buf)+(76))>>2)] = tempI64[1]);
5327
- HEAPU32[(((buf)+(80))>>2)] = (ctime % 1000) * 1000;
5328
- (tempI64 = [stat.ino>>>0,(tempDouble = stat.ino,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(88))>>2)] = tempI64[0],HEAP32[(((buf)+(92))>>2)] = tempI64[1]);
5365
+ (tempI64 = [Math.floor(atime / 1000)>>>0,(tempDouble = Math.floor(atime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(40))>>2)] = tempI64[0],HEAP32[(((buf)+(44))>>2)] = tempI64[1]);checkInt64(Math.floor(atime / 1000));
5366
+ HEAPU32[(((buf)+(48))>>2)] = (atime % 1000) * 1000;checkInt32((atime % 1000) * 1000);
5367
+ (tempI64 = [Math.floor(mtime / 1000)>>>0,(tempDouble = Math.floor(mtime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(56))>>2)] = tempI64[0],HEAP32[(((buf)+(60))>>2)] = tempI64[1]);checkInt64(Math.floor(mtime / 1000));
5368
+ HEAPU32[(((buf)+(64))>>2)] = (mtime % 1000) * 1000;checkInt32((mtime % 1000) * 1000);
5369
+ (tempI64 = [Math.floor(ctime / 1000)>>>0,(tempDouble = Math.floor(ctime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(72))>>2)] = tempI64[0],HEAP32[(((buf)+(76))>>2)] = tempI64[1]);checkInt64(Math.floor(ctime / 1000));
5370
+ HEAPU32[(((buf)+(80))>>2)] = (ctime % 1000) * 1000;checkInt32((ctime % 1000) * 1000);
5371
+ (tempI64 = [stat.ino>>>0,(tempDouble = stat.ino,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(88))>>2)] = tempI64[0],HEAP32[(((buf)+(92))>>2)] = tempI64[1]);checkInt64(stat.ino);
5329
5372
  return 0;
5330
5373
  },
5331
5374
  doMsync(addr, stream, len, flags, offset) {
@@ -5421,7 +5464,7 @@ function dbg(text) {
5421
5464
  }
5422
5465
 
5423
5466
  var setErrNo = (value) => {
5424
- HEAP32[((___errno_location())>>2)] = value;
5467
+ HEAP32[((___errno_location())>>2)] = value;checkInt32(value);
5425
5468
  return value;
5426
5469
  };
5427
5470
 
@@ -5457,7 +5500,7 @@ function dbg(text) {
5457
5500
  var arg = SYSCALLS.getp();
5458
5501
  var offset = 0;
5459
5502
  // We're always unlocked.
5460
- HEAP16[(((arg)+(offset))>>1)] = 2;
5503
+ HEAP16[(((arg)+(offset))>>1)] = 2;checkInt16(2);
5461
5504
  return 0;
5462
5505
  }
5463
5506
  case 6:
@@ -5708,24 +5751,24 @@ function dbg(text) {
5708
5751
 
5709
5752
 
5710
5753
  var date = new Date(time*1000);
5711
- HEAP32[((tmPtr)>>2)] = date.getSeconds();
5712
- HEAP32[(((tmPtr)+(4))>>2)] = date.getMinutes();
5713
- HEAP32[(((tmPtr)+(8))>>2)] = date.getHours();
5714
- HEAP32[(((tmPtr)+(12))>>2)] = date.getDate();
5715
- HEAP32[(((tmPtr)+(16))>>2)] = date.getMonth();
5716
- HEAP32[(((tmPtr)+(20))>>2)] = date.getFullYear()-1900;
5717
- HEAP32[(((tmPtr)+(24))>>2)] = date.getDay();
5754
+ HEAP32[((tmPtr)>>2)] = date.getSeconds();checkInt32(date.getSeconds());
5755
+ HEAP32[(((tmPtr)+(4))>>2)] = date.getMinutes();checkInt32(date.getMinutes());
5756
+ HEAP32[(((tmPtr)+(8))>>2)] = date.getHours();checkInt32(date.getHours());
5757
+ HEAP32[(((tmPtr)+(12))>>2)] = date.getDate();checkInt32(date.getDate());
5758
+ HEAP32[(((tmPtr)+(16))>>2)] = date.getMonth();checkInt32(date.getMonth());
5759
+ HEAP32[(((tmPtr)+(20))>>2)] = date.getFullYear()-1900;checkInt32(date.getFullYear()-1900);
5760
+ HEAP32[(((tmPtr)+(24))>>2)] = date.getDay();checkInt32(date.getDay());
5718
5761
 
5719
5762
  var yday = ydayFromDate(date)|0;
5720
- HEAP32[(((tmPtr)+(28))>>2)] = yday;
5721
- HEAP32[(((tmPtr)+(36))>>2)] = -(date.getTimezoneOffset() * 60);
5763
+ HEAP32[(((tmPtr)+(28))>>2)] = yday;checkInt32(yday);
5764
+ HEAP32[(((tmPtr)+(36))>>2)] = -(date.getTimezoneOffset() * 60);checkInt32(-(date.getTimezoneOffset() * 60));
5722
5765
 
5723
5766
  // Attention: DST is in December in South, and some regions don't have DST at all.
5724
5767
  var start = new Date(date.getFullYear(), 0, 1);
5725
5768
  var summerOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
5726
5769
  var winterOffset = start.getTimezoneOffset();
5727
5770
  var dst = (summerOffset != winterOffset && date.getTimezoneOffset() == Math.min(winterOffset, summerOffset))|0;
5728
- HEAP32[(((tmPtr)+(32))>>2)] = dst;
5771
+ HEAP32[(((tmPtr)+(32))>>2)] = dst;checkInt32(dst);
5729
5772
  ;
5730
5773
  }
5731
5774
 
@@ -5744,7 +5787,7 @@ function dbg(text) {
5744
5787
  var stream = SYSCALLS.getStreamFromFD(fd);
5745
5788
  var res = FS.mmap(stream, len, offset, prot, flags);
5746
5789
  var ptr = res.ptr;
5747
- HEAP32[((allocated)>>2)] = res.allocated;
5790
+ HEAP32[((allocated)>>2)] = res.allocated;checkInt32(res.allocated);
5748
5791
  HEAPU32[((addr)>>2)] = ptr;
5749
5792
  return 0;
5750
5793
  } catch (e) {
@@ -5803,9 +5846,9 @@ function dbg(text) {
5803
5846
  // Coordinated Universal Time (UTC) and local standard time."), the same
5804
5847
  // as returned by stdTimezoneOffset.
5805
5848
  // See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html
5806
- HEAPU32[((timezone)>>2)] = stdTimezoneOffset * 60;
5849
+ HEAPU32[((timezone)>>2)] = stdTimezoneOffset * 60;checkInt32(stdTimezoneOffset * 60);
5807
5850
 
5808
- HEAP32[((daylight)>>2)] = Number(winterOffset != summerOffset);
5851
+ HEAP32[((daylight)>>2)] = Number(winterOffset != summerOffset);checkInt32(Number(winterOffset != summerOffset));
5809
5852
 
5810
5853
  function extractZone(date) {
5811
5854
  var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/);
@@ -5817,14 +5860,18 @@ function dbg(text) {
5817
5860
  var summerNamePtr = stringToNewUTF8(summerName);
5818
5861
  if (summerOffset < winterOffset) {
5819
5862
  // Northern hemisphere
5820
- HEAPU32[((tzname)>>2)] = winterNamePtr;
5821
- HEAPU32[(((tzname)+(4))>>2)] = summerNamePtr;
5863
+ HEAPU32[((tzname)>>2)] = winterNamePtr;checkInt32(winterNamePtr);
5864
+ HEAPU32[(((tzname)+(4))>>2)] = summerNamePtr;checkInt32(summerNamePtr);
5822
5865
  } else {
5823
- HEAPU32[((tzname)>>2)] = summerNamePtr;
5824
- HEAPU32[(((tzname)+(4))>>2)] = winterNamePtr;
5866
+ HEAPU32[((tzname)>>2)] = summerNamePtr;checkInt32(summerNamePtr);
5867
+ HEAPU32[(((tzname)+(4))>>2)] = winterNamePtr;checkInt32(winterNamePtr);
5825
5868
  }
5826
5869
  };
5827
5870
 
5871
+ var _abort = () => {
5872
+ abort('native code called abort()');
5873
+ };
5874
+
5828
5875
  var _emscripten_date_now = () => Date.now();
5829
5876
 
5830
5877
  var getHeapMax = () =>
@@ -5845,6 +5892,7 @@ function dbg(text) {
5845
5892
  var _emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);
5846
5893
 
5847
5894
 
5895
+
5848
5896
  var growMemory = (size) => {
5849
5897
  var b = wasmMemory.buffer;
5850
5898
  var pages = (size - b.byteLength + 65535) / 65536;
@@ -5904,7 +5952,10 @@ function dbg(text) {
5904
5952
 
5905
5953
  var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
5906
5954
 
5955
+ var t0 = _emscripten_get_now();
5907
5956
  var replacement = growMemory(newSize);
5957
+ var t1 = _emscripten_get_now();
5958
+ dbg(`Heap resize call from ${oldSize} to ${newSize} took ${(t1 - t0)} msecs. Success: ${!!replacement}`);
5908
5959
  if (replacement) {
5909
5960
 
5910
5961
  return true;
@@ -5954,17 +6005,17 @@ function dbg(text) {
5954
6005
  var stringToAscii = (str, buffer) => {
5955
6006
  for (var i = 0; i < str.length; ++i) {
5956
6007
  assert(str.charCodeAt(i) === (str.charCodeAt(i) & 0xff));
5957
- HEAP8[((buffer++)>>0)] = str.charCodeAt(i);
6008
+ HEAP8[((buffer++)>>0)] = str.charCodeAt(i);checkInt8(str.charCodeAt(i));
5958
6009
  }
5959
6010
  // Null-terminate the string
5960
- HEAP8[((buffer)>>0)] = 0;
6011
+ HEAP8[((buffer)>>0)] = 0;checkInt8(0);
5961
6012
  };
5962
6013
 
5963
6014
  var _environ_get = (__environ, environ_buf) => {
5964
6015
  var bufSize = 0;
5965
6016
  getEnvStrings().forEach((string, i) => {
5966
6017
  var ptr = environ_buf + bufSize;
5967
- HEAPU32[(((__environ)+(i*4))>>2)] = ptr;
6018
+ HEAPU32[(((__environ)+(i*4))>>2)] = ptr;checkInt32(ptr);
5968
6019
  stringToAscii(string, ptr);
5969
6020
  bufSize += string.length + 1;
5970
6021
  });
@@ -5974,10 +6025,10 @@ function dbg(text) {
5974
6025
 
5975
6026
  var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
5976
6027
  var strings = getEnvStrings();
5977
- HEAPU32[((penviron_count)>>2)] = strings.length;
6028
+ HEAPU32[((penviron_count)>>2)] = strings.length;checkInt32(strings.length);
5978
6029
  var bufSize = 0;
5979
6030
  strings.forEach((string) => bufSize += string.length + 1);
5980
- HEAPU32[((penviron_buf_size)>>2)] = bufSize;
6031
+ HEAPU32[((penviron_buf_size)>>2)] = bufSize;checkInt32(bufSize);
5981
6032
  return 0;
5982
6033
  };
5983
6034
 
@@ -6008,10 +6059,10 @@ function dbg(text) {
6008
6059
  FS.isLink(stream.mode) ? 7 :
6009
6060
  4;
6010
6061
  }
6011
- HEAP8[((pbuf)>>0)] = type;
6012
- HEAP16[(((pbuf)+(2))>>1)] = flags;
6013
- (tempI64 = [rightsBase>>>0,(tempDouble = rightsBase,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((pbuf)+(8))>>2)] = tempI64[0],HEAP32[(((pbuf)+(12))>>2)] = tempI64[1]);
6014
- (tempI64 = [rightsInheriting>>>0,(tempDouble = rightsInheriting,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((pbuf)+(16))>>2)] = tempI64[0],HEAP32[(((pbuf)+(20))>>2)] = tempI64[1]);
6062
+ HEAP8[((pbuf)>>0)] = type;checkInt8(type);
6063
+ HEAP16[(((pbuf)+(2))>>1)] = flags;checkInt16(flags);
6064
+ (tempI64 = [rightsBase>>>0,(tempDouble = rightsBase,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((pbuf)+(8))>>2)] = tempI64[0],HEAP32[(((pbuf)+(12))>>2)] = tempI64[1]);checkInt64(rightsBase);
6065
+ (tempI64 = [rightsInheriting>>>0,(tempDouble = rightsInheriting,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((pbuf)+(16))>>2)] = tempI64[0],HEAP32[(((pbuf)+(20))>>2)] = tempI64[1]);checkInt64(rightsInheriting);
6015
6066
  return 0;
6016
6067
  } catch (e) {
6017
6068
  if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e;
@@ -6042,7 +6093,7 @@ function dbg(text) {
6042
6093
 
6043
6094
  var stream = SYSCALLS.getStreamFromFD(fd);
6044
6095
  var num = doReadv(stream, iov, iovcnt);
6045
- HEAPU32[((pnum)>>2)] = num;
6096
+ HEAPU32[((pnum)>>2)] = num;checkInt32(num);
6046
6097
  return 0;
6047
6098
  } catch (e) {
6048
6099
  if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e;
@@ -6060,7 +6111,7 @@ function dbg(text) {
6060
6111
  if (isNaN(offset)) return 61;
6061
6112
  var stream = SYSCALLS.getStreamFromFD(fd);
6062
6113
  FS.llseek(stream, offset, whence);
6063
- (tempI64 = [stream.position>>>0,(tempDouble = stream.position,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((newOffset)>>2)] = tempI64[0],HEAP32[(((newOffset)+(4))>>2)] = tempI64[1]);
6114
+ (tempI64 = [stream.position>>>0,(tempDouble = stream.position,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((newOffset)>>2)] = tempI64[0],HEAP32[(((newOffset)+(4))>>2)] = tempI64[1]);checkInt64(stream.position);
6064
6115
  if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state
6065
6116
  return 0;
6066
6117
  } catch (e) {
@@ -6106,7 +6157,7 @@ function dbg(text) {
6106
6157
 
6107
6158
  var stream = SYSCALLS.getStreamFromFD(fd);
6108
6159
  var num = doWritev(stream, iov, iovcnt);
6109
- HEAPU32[((pnum)>>2)] = num;
6160
+ HEAPU32[((pnum)>>2)] = num;checkInt32(num);
6110
6161
  return 0;
6111
6162
  } catch (e) {
6112
6163
  if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e;
@@ -6411,6 +6462,7 @@ function dbg(text) {
6411
6462
 
6412
6463
 
6413
6464
 
6465
+
6414
6466
  /** @param {string=} sig */
6415
6467
  var addFunction = (func, sig) => {
6416
6468
  assert(typeof func != 'undefined');
@@ -6423,6 +6475,13 @@ function dbg(text) {
6423
6475
 
6424
6476
  // It's not in the table, add it now.
6425
6477
 
6478
+ // Make sure functionsInTableMap is actually up to date, that is, that this
6479
+ // function is not actually in the wasm Table despite not being tracked in
6480
+ // functionsInTableMap.
6481
+ for (var i = 0; i < wasmTable.length; i++) {
6482
+ assert(getWasmTableEntry(i) != func, 'function in Table but not functionsInTableMap');
6483
+ }
6484
+
6426
6485
  var ret = getEmptyTableSlot();
6427
6486
 
6428
6487
  // Set the new value.
@@ -6497,6 +6556,8 @@ var wasmImports = {
6497
6556
  /** @export */
6498
6557
  __assert_fail: ___assert_fail,
6499
6558
  /** @export */
6559
+ __handle_stack_overflow: ___handle_stack_overflow,
6560
+ /** @export */
6500
6561
  __syscall_chmod: ___syscall_chmod,
6501
6562
  /** @export */
6502
6563
  __syscall_faccessat: ___syscall_faccessat,
@@ -6541,6 +6602,8 @@ var wasmImports = {
6541
6602
  /** @export */
6542
6603
  _tzset_js: __tzset_js,
6543
6604
  /** @export */
6605
+ abort: _abort,
6606
+ /** @export */
6544
6607
  emscripten_date_now: _emscripten_date_now,
6545
6608
  /** @export */
6546
6609
  emscripten_get_heap_max: _emscripten_get_heap_max,
@@ -6625,6 +6688,7 @@ var stackSave = createExportWrapper('stackSave');
6625
6688
  var stackRestore = createExportWrapper('stackRestore');
6626
6689
  var stackAlloc = createExportWrapper('stackAlloc');
6627
6690
  var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
6691
+ var ___set_stack_limits = Module['___set_stack_limits'] = createExportWrapper('__set_stack_limits');
6628
6692
  var dynCall_iiiij = Module['dynCall_iiiij'] = createExportWrapper('dynCall_iiiij');
6629
6693
  var dynCall_iij = Module['dynCall_iij'] = createExportWrapper('dynCall_iij');
6630
6694
  var dynCall_iijii = Module['dynCall_iijii'] = createExportWrapper('dynCall_iijii');
@@ -6830,6 +6894,7 @@ var unexportedSymbols = [
6830
6894
  'getHeapMax',
6831
6895
  'growMemory',
6832
6896
  'ENV',
6897
+ 'setStackLimits',
6833
6898
  'MONTH_DAYS_REGULAR',
6834
6899
  'MONTH_DAYS_LEAP',
6835
6900
  'MONTH_DAYS_REGULAR_CUMULATIVE',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sql.js",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "SQLite library with support for opening and writing databases, prepared statements, and more. This SQLite library is in pure javascript (compiled with emscripten).",
5
5
  "keywords": [
6
6
  "sql",