-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Issue 975 Bugfix TypeAssigner, TypePromotionVisitor filter Constants #985
Conversation
@@ -56,6 +56,13 @@ public static boolean isIntermediateType(Type type) { | |||
} | |||
|
|||
public void visit(@Nonnull Value value, @Nonnull Type stdType, @Nonnull Stmt stmt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we be more specific?
public void visit(@Nonnull Value value, @Nonnull Type stdType, @Nonnull Stmt stmt) { | |
public void visit(@Nonnull Local value, @Nonnull Type stdType, @Nonnull Stmt stmt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
||
/* 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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
run tc using java8 or add new DefaultRTJarAnalysisInputLocation() input location in view