Skip to content

Commit 28a5ba1

Browse files
authored
Introduce leak sanitizer, fix several string leaks (#59)
* more doc polish * Free C strings returned from QuickJS * Add address sanitizer * Fix some leaks! * Fix some leaks in test * unfix an over-fixed test * doc * Fix sanitize dingus * Santizer self test * Split sanitizer out to own define * enable -ftlo link time optimization for release build * Remove extra string copy for QTS_GetString/QTS_Dump * oops: leak build * finally get C++ include settings working for emscripten.h
1 parent 984aa6d commit 28a5ba1

File tree

84 files changed

+14914
-706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+14914
-706
lines changed

.github/workflows/main.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,24 @@ jobs:
4242
uses: actions/cache@v2
4343
with:
4444
path: "**/.yarn/cache"
45-
key: ${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
45+
key: ${{ hashFiles('**/yarn.lock') }}
4646

4747
- name: Install dependencies
4848
run: yarn install --immutable
4949
env:
5050
YARN_ENABLE_SCRIPTS: 0
5151

52-
- name: Test debug
53-
run: make clean && yarn test
52+
- name: Build
53+
run: yarn build
5454

55-
- name: Prettier
56-
run: yarn run prettier-check
57-
58-
- name: Build release
59-
run: yarn make-release && yarn build && yarn tarball
60-
61-
- name: Test release
62-
run: yarn run mocha
55+
- name: Test
56+
run: yarn test-all
6357

6458
- name: Test release with NodeJS/Typescript example
6559
run: yarn smoketest-node
6660

6761
- name: Test release with create-react-app/Typescript example
6862
run: yarn smoketest-cra
63+
64+
- name: Prettier
65+
run: yarn run prettier-check

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ node_modules
22
yarn-error.log
33
npm-error.log
44

5-
*.wasm
6-
*.wasm.map
75
*.tsbuildinfo
6+
.vscode/*.log
87

98
/build
109
/dist

.prettierignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
ts/ffi.ts
2-
ts/ffi-asyncify.ts
3-
*.emscripten-module.js
1+
ts/generated
42
quickjs
53
.yarn
64
doc
75
test/json-generator-dot-com-1024-rows.json
8-
dist/*
6+
dist
97
examples/imports
108
examples/typescript-smoketest/*.js
119
build

.vscode/c_cpp_properties.json

+30-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,42 @@
22
"configurations": [
33
{
44
"name": "Mac",
5-
"includePath": ["${workspaceFolder}/**"],
6-
"defines": ["QTS_ASYNCIFY=1", "QTS_DEBUG=1"],
5+
"includePath": [
6+
"${workspaceFolder}/**",
7+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/system/include/**",
8+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include/**",
9+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/llvm/lib/clang/15.0.0/include/**",
10+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include/SDL",
11+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include/compat",
12+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/llvm/lib/clang/15.0.0/include",
13+
"/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include"
14+
],
15+
"defines": ["QTS_ASYNCIFY=1", "QTS_DEBUG_MODE=1", "__EMSCRIPTEN__=1"],
716
"macFrameworkPath": [
817
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
918
],
1019
"compilerPath": "/usr/bin/clang",
1120
"cStandard": "c17",
1221
"cppStandard": "c++98",
22+
"intelliSenseMode": "macos-clang-arm64",
23+
"compilerArgs": [],
24+
"mergeConfigurations": false,
25+
"browse": {
26+
"path": ["${workspaceFolder}/**"],
27+
"limitSymbolsToIncludedHeaders": true
28+
},
29+
"configurationProvider": "ms-vscode.makefile-tools"
30+
},
31+
{
32+
"name": "Emscripten",
33+
"includePath": ["${workspaceFolder}/**"],
34+
"defines": [],
35+
"macFrameworkPath": [
36+
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
37+
],
38+
"compilerPath": "/opt/homebrew/bin/emcc",
39+
"cStandard": "c17",
40+
"cppStandard": "c++98",
1341
"intelliSenseMode": "macos-clang-arm64"
1442
}
1543
],

.vscode/settings.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
2-
"cSpell.words": ["Asyncified", "ASYNCIFY", "chonkers", "JSWASM", "runtimes"],
2+
"cSpell.words": ["Asyncified", "ASYNCIFY", "chonkers", "JSFFI", "JSWASM", "runtimes"],
33
"files.associations": {
44
"cutils.h": "c",
55
"quickjs.h": "c",
66
"quickjs-libc.h": "c",
7-
"stdio.h": "c"
7+
"stdio.h": "c",
8+
"lsan_interface.h": "c",
9+
"math.h": "c",
10+
"stdbool.h": "c",
11+
"emscripten.h": "c"
812
}
913
}

0 commit comments

Comments
 (0)