Commit df45f00
authored
[SYCL][NFC] Fix static code analysis concerns (#2531)
Found via a static-analysis tool:
1. Pointer 'NewDeclAttr' returned from call to function 'getAttr<clang::SYCLIntelMaxWorkGroupSizeAttr>'
at line 3218 may be NULL and will be dereferenced at line 3220.
2. Pointer 'NewDeclAttr' returned from call to function 'getAttr<clang::ReqdWorkGroupSizeAttr>'
at line 3218 may be NULL and will be dereferenced at line 3220.
3. Pointer 'OldDeclAttr' returned from call to function 'getAttr<clang::ReqdWorkGroupSizeAttr>'
at line 3219 may be NULL and will be dereferenced at line 3220.
4. Pointer 'OldDeclAttr' returned from call to function 'getAttr<clang::SYCLIntelMaxWorkGroupSizeAttr>'
at line 3219 may be NULL and will be dereferenced at line 3220.
This patch fixes null pointer dereference issues in SemaDecl.cpp file
by adding early return if (!NewDeclAttr || !OldDeclAttr)
Signed-off-by: Soumi Manna <[email protected]>1 parent efe6331 commit df45f00
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3215 | 3215 | | |
3216 | 3216 | | |
3217 | 3217 | | |
3218 | | - | |
3219 | | - | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
3220 | 3224 | | |
3221 | 3225 | | |
3222 | 3226 | | |
| |||
3302 | 3306 | | |
3303 | 3307 | | |
3304 | 3308 | | |
3305 | | - | |
3306 | | - | |
3307 | 3309 | | |
3308 | 3310 | | |
3309 | | - | |
3310 | | - | |
3311 | 3311 | | |
3312 | 3312 | | |
3313 | 3313 | | |
| |||
0 commit comments