mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 23:19:44 +00:00
LibJS: Handle out-of-range prefixed numbers in Token::double_value
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This regressed in cd15b1a2c9
.
If a prefixed number is out-of-range of a u64, stroul would previously
fall back to ULONG_MAX. This patch restores that behavior.
This commit is contained in:
parent
652a457f52
commit
e2b245add1
Notes:
github-actions[bot]
2025-08-10 11:36:34 +00:00
Author: https://github.com/trflynn89
Commit: e2b245add1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5805
2 changed files with 20 additions and 4 deletions
|
@ -50,3 +50,18 @@ test("invalid numeric literals", () => {
|
|||
expect("1in[]").not.toEval();
|
||||
expect("2instanceof foo").not.toEval();
|
||||
});
|
||||
|
||||
test("out-of-range literals", () => {
|
||||
expect(0x10000000000000000).toBe(18446744073709552000);
|
||||
expect(-0x10000000000000000).toBe(-18446744073709552000);
|
||||
|
||||
expect(0o2000000000000000000000).toBe(18446744073709552000);
|
||||
expect(-0o2000000000000000000000).toBe(-18446744073709552000);
|
||||
|
||||
expect(0b10000000000000000000000000000000000000000000000000000000000000000).toBe(
|
||||
18446744073709552000
|
||||
);
|
||||
expect(-0b10000000000000000000000000000000000000000000000000000000000000000).toBe(
|
||||
-18446744073709552000
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue