Skip to content

Fix for Shift out of range#20

Draft
Lawrence Lucas Large (LukeLarge) wants to merge 1 commit into
mainfrom
finding-autofix-19036474
Draft

Fix for Shift out of range#20
Lawrence Lucas Large (LukeLarge) wants to merge 1 commit into
mainfrom
finding-autofix-19036474

Conversation

@LukeLarge
Copy link
Copy Markdown

General fix: replace out-of-range bit shift expressions with arithmetic or constants that correctly represent 32-bit bounds in JS/TS number semantics.

Best fix here: in tests/WalletW5.spec.ts at line 786, replace (1 << 32) - 1 with 0xFFFFFFFF (equivalently 2 ** 32 - 1). This preserves intended functionality (random opcode from 1..4294967295) without changing behavior elsewhere and avoids introducing new imports/dependencies.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Lawrence Lucas Large <162439255+LukeLarge@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 8, 2026 21:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes a JavaScript/TypeScript << shift overflow by replacing an out-of-range bit shift expression with a correct 32-bit max constant, preserving the intended random opcode range.

Changes:

  • Replaced (1 << 32) - 1 with 0xFFFFFFFF to represent the 32-bit unsigned maximum safely in JS/TS number semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/WalletW5.spec.ts

do {
testOp = getRandomInt(1, (1 << 32) - 1);
testOp = getRandomInt(1, 0xFFFFFFFF);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants