This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit 80867d1
Sergey Andreenko
Fix simple general warnings found by PVS. (#27283)
* Delete unused `scAvailable`.
* Delete unused `PhysRegIntervalIterator`.
* Expression is always true.
* Possible overflow.
* Delete unreachable/unused code.
* Two or more case-branches perform the same actions.
* Check self-copying.
* The 'isOnStack' variable is assigned values twice successively.
* The 'then' statement is equivalent to the 'else' statement.
`MAX_COST` is `UCHAR_MAX` so if `unsigned char cost >= MAX_COST` then it is equal to ``MAX_COST`.
So the code was correct, but confusing.
* Expression 'newPage == nullptr' is always true.
* Expression 'inconsistentProfileData' is always false.
* A part of conditional expression is always false: typ == TYP_BOOL.
* A part of conditional expression is always true: emitFullGCinfo.
We have an early return from this function if `emitFullGCinfo == false`.
* A part of conditional expression is always true: asgNode.
We have an early return if it is nullptr.
* delete an unused function with errors.
There were 3 incorrent printf arguments.
* Delete another unused function without return.
* An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression,
* The expression is of enum type. It is odd that it is used as an expression of a Boolean-type.
* the usage of '#pragma warning(default: X)' is incorrect in this context. The '#pragma warning(push/pop)' should be used instead.
That function and almost the whole file is unused, do we want to delete it?
* The expression 'eeGetHelperNum(method)' is of enum type. It is odd that it is used as an expression of a Boolean-type.
* `nodeThis` and `nodeOther` are always true.
* 'this == nullptr' expression should be avoided - this expression is always false on newer compilers, because 'this' pointer can never be NULL.
Don't compare `this` with null.
* Variables 'm_Cost', 'm_Size' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'Expr()->GetCostSz()' expression.
* Parameter 'toRefPosition' is not used inside function body.
* Expression 'parentOfArgObj == parentArgx' is always true.
We assigned `parentOfArgObj ` to `parentArgx` and did not change any of them before that check.
* The 'srcCount' variable is assigned values twice successively. Perhaps this is a mistake.
* Response review.1 parent 9cae8fa commit 80867d1
File tree
26 files changed
+47
-160
lines changed- src
- inc
- jit
- jitstd
26 files changed
+47
-160
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| 527 | + | |
527 | 528 | | |
528 | 529 | | |
529 | 530 | | |
| |||
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
535 | | - | |
| 536 | + | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 95 | + | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
650 | | - | |
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10183 | 10183 | | |
10184 | 10184 | | |
10185 | 10185 | | |
10186 | | - | |
10187 | | - | |
| 10186 | + | |
| 10187 | + | |
10188 | 10188 | | |
10189 | 10189 | | |
10190 | 10190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8092 | 8092 | | |
8093 | 8093 | | |
8094 | 8094 | | |
8095 | | - | |
8096 | | - | |
8097 | | - | |
8098 | | - | |
8099 | | - | |
8100 | | - | |
8101 | | - | |
8102 | | - | |
8103 | | - | |
| 8095 | + | |
| 8096 | + | |
| 8097 | + | |
| 8098 | + | |
| 8099 | + | |
8104 | 8100 | | |
8105 | 8101 | | |
8106 | 8102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3592 | 3592 | | |
3593 | 3593 | | |
3594 | 3594 | | |
3595 | | - | |
| 3595 | + | |
3596 | 3596 | | |
3597 | 3597 | | |
3598 | 3598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1308 | 1308 | | |
1309 | 1309 | | |
1310 | 1310 | | |
1311 | | - | |
| 1311 | + | |
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7375 | 7375 | | |
7376 | 7376 | | |
7377 | 7377 | | |
7378 | | - | |
| 7378 | + | |
7379 | 7379 | | |
7380 | 7380 | | |
7381 | 7381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10433 | 10433 | | |
10434 | 10434 | | |
10435 | 10435 | | |
10436 | | - | |
10437 | | - | |
10438 | | - | |
10439 | | - | |
| 10436 | + | |
| 10437 | + | |
10440 | 10438 | | |
10441 | 10439 | | |
10442 | 10440 | | |
| |||
13652 | 13650 | | |
13653 | 13651 | | |
13654 | 13652 | | |
13655 | | - | |
13656 | | - | |
13657 | | - | |
13658 | | - | |
13659 | | - | |
| 13653 | + | |
13660 | 13654 | | |
13661 | 13655 | | |
13662 | 13656 | | |
| |||
15011 | 15005 | | |
15012 | 15006 | | |
15013 | 15007 | | |
15014 | | - | |
15015 | | - | |
| 15008 | + | |
15016 | 15009 | | |
15017 | 15010 | | |
15018 | 15011 | | |
| |||
15022 | 15015 | | |
15023 | 15016 | | |
15024 | 15017 | | |
15025 | | - | |
| 15018 | + | |
15026 | 15019 | | |
15027 | | - | |
| 15020 | + | |
15028 | 15021 | | |
15029 | 15022 | | |
15030 | 15023 | | |
| |||
19240 | 19233 | | |
19241 | 19234 | | |
19242 | 19235 | | |
19243 | | - | |
19244 | | - | |
19245 | | - | |
19246 | | - | |
19247 | | - | |
19248 | | - | |
19249 | | - | |
19250 | | - | |
19251 | | - | |
19252 | | - | |
| 19236 | + | |
19253 | 19237 | | |
19254 | 19238 | | |
19255 | 19239 | | |
| |||
0 commit comments