-
Notifications
You must be signed in to change notification settings - Fork 756
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
Add null check before accessing type.tsymbol
in CodeAnalyzer
#43733
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #43733 +/- ##
============================================
- Coverage 77.55% 77.41% -0.15%
+ Complexity 58722 58616 -106
============================================
Files 3447 3445 -2
Lines 219658 219173 -485
Branches 28915 28969 +54
============================================
- Hits 170365 169663 -702
- Misses 39892 40081 +189
- Partials 9401 9429 +28 ☔ View full report in Codecov by Sentry. |
if (cIExpr.userDefinedType != null && type.tsymbol != null && | ||
Symbols.isFlagOn(type.tsymbol.flags, Flags.DEPRECATED)) { |
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.
Here, we need to check whether the DEPRECATED
flag is present in the symbol of the userDefinedType
(BLangUserDefinedType
), isn't it?
@@ -2804,7 +2804,8 @@ public void visit(BLangTypeInit cIExpr, AnalyzerData data) { | |||
analyzeExprs(cIExpr.argsExpr, data); | |||
analyzeExpr(cIExpr.initInvocation, data); | |||
BType type = cIExpr.getBType(); | |||
if (cIExpr.userDefinedType != null && Symbols.isFlagOn(type.tsymbol.flags, Flags.DEPRECATED)) { | |||
if (cIExpr.userDefinedType != null && type.tsymbol != null && |
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.
Shall we make this a draft PR? I wouldn't introduce this change without getting the issue reproduced.
Closing this as this is not the correct fix |
Purpose
$title
Fixes #43286