-
Notifications
You must be signed in to change notification settings - Fork 21
Fix potential bug IntelliJ warnings #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andreaTP
merged 5 commits into
bytecodealliance:main
from
Marcono1234:bug-intellij-warnings
Sep 15, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
511f23c
Fix potential bug IntelliJ warnings
Marcono1234 a4d500e
Fix Generator using wrong Parser.parse overload
andreaTP 700bcad
Fix SIMD float lt using <= instead of <
andreaTP dd837cf
Fix interpreter I32_MUL leaking upper 32 bits
andreaTP c8ea35d
Merge branch 'main' into bug-intellij-warnings
andreaTP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -1307,7 +1307,8 @@ private static void I64_SUB(MStack stack) { | |
| private static void I32_MUL(MStack stack) { | ||
| var a = stack.pop(); | ||
| var b = stack.pop(); | ||
| stack.push(a * b); | ||
| int result = (int) (a * b); | ||
| stack.push(result); | ||
| } | ||
|
|
||
| private static void I64_MUL(MStack stack) { | ||
|
|
@@ -1507,6 +1508,9 @@ private static void I32_SHR_S(MStack stack) { | |
| private static void I32_SHL(MStack stack) { | ||
| var c = (int) stack.pop(); | ||
| var v = (int) stack.pop(); | ||
| // Intentionally get the result as 32 bit `int` (despite it being converted to `long` when | ||
| // pushed to the stack) | ||
| //noinspection IntegerMultiplicationImplicitCastToLong | ||
| stack.push(v << c); | ||
|
Comment on lines
+1511
to
1514
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IntelliJ was warning that because I assume that is intended here though since this is an operation for i32? Not completely sure though. |
||
| } | ||
|
|
||
|
|
@@ -3239,7 +3243,7 @@ private static void TRY_TABLE( | |
|
|
||
| private static void IF( | ||
| StackFrame frame, MStack stack, Instance instance, AnnotatedInstruction instruction) { | ||
| var predValue = stack.pop(); | ||
| var predValue = (int) stack.pop(); | ||
| var paramsSize = numberOfParams(instance, instruction); | ||
| var returnsSize = numberOfValuesToReturn(instance, instruction); | ||
| frame.pushCtrl(instruction.opcode(), paramsSize, returnsSize, stack.size() - paramsSize); | ||
|
|
||
This file contains hidden or 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 hidden or 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
Binary file not shown.
This file contains hidden or 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,13 @@ | ||
| (module | ||
| ;; mul(a, b) returns a*b wrapped to 32 bits | ||
| (func (export "mul") (param $a i32) (param $b i32) (result i32) | ||
| (i32.mul (local.get $a) (local.get $b)) | ||
| ) | ||
| ;; mul_if(a, b) returns 1 if the wrapped a*b is non-zero, 0 otherwise | ||
| (func (export "mul_if") (param $a i32) (param $b i32) (result i32) | ||
| (if (result i32) (i32.mul (local.get $a) (local.get $b)) | ||
| (then (i32.const 1)) | ||
| (else (i32.const 0)) | ||
| ) | ||
| ) | ||
| ) |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.