-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from a-rodin/stack-overflow-signed
Implement patched feature and fix stackoverflow in quickjs.
- Loading branch information
Showing
8 changed files
with
101 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,47 @@ | ||
version: 2.0 | ||
jobs: | ||
build: | ||
docker: | ||
- image: debian | ||
version: 2.1 | ||
|
||
commands: | ||
tests: | ||
description: "Run tests" | ||
parameters: | ||
features: | ||
type: string | ||
steps: | ||
- checkout | ||
- run: | ||
name: Setup, Build & Test | ||
name: Setup | ||
command: | | ||
export PATH="$HOME/.cargo/bin:$HOME:$PATH" | ||
echo "Installing curl..." | ||
apt-get update && apt-get install -y curl | ||
echo "Installing Rust..." | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | ||
echo "Installing just..." | ||
curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git casey/just --target x86_64-unknown-linux-musl --to $HOME | ||
hash -r | ||
just ci-debian | ||
- run: | ||
name: Test | ||
command: | | ||
export PATH="$HOME/.cargo/bin:$HOME:$PATH" | ||
just FEATURES="<<parameters.features>>" ci-debian | ||
jobs: | ||
test-features-default: | ||
docker: | ||
- image: debian | ||
steps: | ||
- tests: | ||
features: "" | ||
test-features-patched: | ||
docker: | ||
- image: debian | ||
steps: | ||
- tests: | ||
features: "patched" | ||
|
||
workflows: | ||
version: 2 | ||
tests: | ||
jobs: | ||
- test-features-default | ||
- test-features-patched | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff -urN quickjs-2019-07-28/quickjs.c quickjs-2019-07-28-stack-overflow-signed/quickjs.c | ||
--- quickjs-2019-07-28/quickjs.c 2019-07-28 15:03:03.000000000 +0000 | ||
+++ quickjs-2019-07-28-stack-overflow-signed/quickjs.c 2019-08-09 20:00:03.666846091 +0000 | ||
@@ -1732,9 +1732,9 @@ | ||
|
||
static inline BOOL js_check_stack_overflow(JSContext *ctx, size_t alloca_size) | ||
{ | ||
- size_t size; | ||
+ ptrdiff_t size; | ||
size = ctx->stack_top - js_get_stack_pointer(); | ||
- return unlikely((size + alloca_size) > ctx->stack_size); | ||
+ return unlikely((size + (ptrdiff_t)alloca_size) > (ptrdiff_t)ctx->stack_size); | ||
} | ||
#endif | ||
|