Issue 975 Bugfix TypeAssigner, TypePromotionVisitor filter Constants#985
Merged
Issue 975 Bugfix TypeAssigner, TypePromotionVisitor filter Constants#985
Conversation
swissiety
reviewed
Jul 17, 2024
| @@ -56,6 +56,13 @@ public static boolean isIntermediateType(Type type) { | |||
| } | |||
|
|
|||
| public void visit(@Nonnull Value value, @Nonnull Type stdType, @Nonnull Stmt stmt) { | |||
Collaborator
There was a problem hiding this comment.
can we be more specific?
Suggested change
| public void visit(@Nonnull Value value, @Nonnull Type stdType, @Nonnull Stmt stmt) { | |
| public void visit(@Nonnull Local value, @Nonnull Type stdType, @Nonnull Stmt stmt) { |
Collaborator
Author
There was a problem hiding this comment.
we are calling visit function with many different types JInstanceOfExpr, JNewArrayExpr etc so changing in parameter directly won't solve.
- if (value instanceof Constant) {return;} I tried this as well instead of [if (!(value instanceof Local))] with different jars but seems like no other special case than Constant so could keep just the check for Constant as well
Collaborator
Author
There was a problem hiding this comment.
regarding 1st point, I found a TC where if we don't promote just constants, it would lead to an invalid type for int1 type to boolean. so reverted
1481a7e to
5190cfe
Compare
stschott
reviewed
Jul 26, 2024
Comment on lines
+59
to
+65
|
|
||
| /* Note: When visiting function parameters, we may encounter constant values such as strings ("abc") or integers (2). | ||
| These constants are not instances of the Local class and should be handled accordingly. | ||
| */ | ||
| if (!(value instanceof Local)) { | ||
| return; | ||
| } |
Collaborator
There was a problem hiding this comment.
Can you please make the comment more specific that we are possibly over-approximating here and if things break in future it might be due to this.
stschott
approved these changes
Jul 26, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
run tc using java8 or add new DefaultRTJarAnalysisInputLocation() input location in view