Skip to content

Commit f4ec97f

Browse files
authored
Fix memory leak on error (#307)
* Create test_memory_leak_on_error.js * fix test_memory_leak_on_error.js * Update test_memory_leak_on_error.js * Update test_memory_leak_on_error.js * Fix a memory leak in db.exec When an error was thrown in db.exec, the allocated stack was never restored * Enable assertions in debug builds * Fix assertion error in debug builds Fix Assertion failed: you need to wait for the runtime to be ready (e.g. wait for main() to be called) * Fix memory leak on error in Database.exec Memory was leaked when Database.exec was run and the execution threw an error * Disable the memory leak test by default The memory leak test is expensive, and we don't want to run it every time * Prevent several memory leaks on error I did not manage to trigger OOM errors with them, but db.run and db.each were also vulnerable to #306 * Check the compiled files in
1 parent e529b7d commit f4ec97f

15 files changed

+48551
-42822
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ EMFLAGS_OPTIMIZED= \
4141

4242
EMFLAGS_DEBUG = \
4343
-s INLINING_LIMIT=10 \
44+
-s ASSERTIONS=1 \
4445
-O1
4546

4647
BITCODE_FILES = out/sqlite3.bc out/extension-functions.bc

0 commit comments

Comments
 (0)