{ "tokens": { "input": 52131, "cache_read": 92944, "cache_write": 40663, "output": 14695 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/c/cctbx/cctbx_2026.9+ds2+~3.30.1+ds1.orig.tar.xz", "your cctbx-cctbx_project-4b6acc4/scitbx/math/tests/tst.cpp:82:32: style: Variable 'a[2]' is assigned an expression that holds the same value. [redundantAssignment]\n cctbx-cctbx_project-4b6acc4/scitbx/math/tests/tst.cpp:82:12: note: a[0] is assigned 'n+1' here.\n cctbx-cctbx_project-4b6acc4/scitbx/math/tests/tst.cpp:82:27: note: Assignment 'a[1]=n+1', assigned value is symbolic=a[0]\n cctbx-cctbx_project-4b6acc4/scitbx/math/tests/tst.cpp:82:24: note: a[1] is assigned 'n+1' here.\n cctbx-cctbx_project-4b6acc4/scitbx/math/tests/tst.cpp:82:32: note: Variable 'a[2]' is assigned an expression that holds the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "Before line 82, a[2] holds n. Line 82 then sets a[2] = n+1, which changes its value from n to n+1, so the assignment is not redundant. The notes show the new symbolic '+' handling in the PR confusing the array elements: it treats a[1]=n+1 as symbolic a[0] and then decides a[2] already holds that value. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/gentle/gentle_1.9.5~alpha2+dfsg1.orig.tar.xz", "main gentle-m-1.9.5.alpha2/src/TVectorEditorEnzymes.cpp:365:19: error: Out of bounds access in expression 'vi[k]' because 'vi' is empty. [containerOutOfBounds]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`vi` is passed by non-const reference to `listCE->GetSelections(vi)`, which fills it and returns its size `n`. The loop runs `k` from `n-1` down to 0, so `vi[k]` is only accessed when `vi` has at least `n` elements. The claim that `vi` is empty is a false positive. The PR's new symbolic +/- handling changes the value flow for `k = n-1`, and the removal of this bogus containerOutOfBounds error is beneficial." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/gentle/gentle_1.9.5~alpha2+dfsg1.orig.tar.xz", "main gentle-m-1.9.5.alpha2/src/TVectorEditorEnzymes.cpp:637:19: error: Out of bounds access in expression 'vi[k]' because 'vi' is empty. [containerOutOfBounds]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`vi` is passed by reference to `listGE->GetSelections(vi)`, which fills it with the selected indices and returns their count `n`. The loop only reads `vi[k]` for `k` in `0..n-1`, so `vi` is not empty when it is indexed. Main's containerOutOfBounds warning was a false positive, and the PR removes it. The exact mechanism (a side effect of the new symbolic +/- values) is not clear from the diff, but the result is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/gwc/gwc_0.22.05.orig.tar.gz", "your gtk-wave-cleaner-0.22-05/dethunk.c:646:5: style: Variable 'n_samples' is assigned an expression that holds the same value. [redundantAssignment]\n gtk-wave-cleaner-0.22-05/dethunk.c:630:20: note: n_samples is assigned 'last_sample-first_sample+1' here.\n gtk-wave-cleaner-0.22-05/dethunk.c:646:5: note: Variable 'n_samples' is assigned an expression that holds the same value." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "Line 630 initializes `n_samples = last_sample - first_sample + 1`. Line 646 assigns exactly the same expression again. `first_sample`, `last_sample` and `n_samples` are locals passed by value, and none of them changes in between; the intervening calls cannot touch them. So the second assignment really is redundant. The PR now propagates symbolic values through `+`/`-` with a constant, which lets Cppcheck see this. The new warning is a true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/macutils/macutils_2.0b3.orig.tar.gz", "main macutils/macunpack/lzh.c:225:11: style: Variable 'ptr' can be declared as pointer to const [constVariablePointer]" ], "verdict": { "verdict": "regression", "confidence": "low", "explanation": "In the code shown, `ptr` is set to `hdr + L_METHOD` and only used for reading (`chk_sum += *ptr++`). So `const char *ptr` looks valid, and main's constVariablePointer warning appears to be a true positive. The PR only adds symbolic values for `+`/`-` expressions and skips invalidFree for `new` offsets. Nothing in it is meant to make constVariablePointer more accurate. The likely cause is that the new symbolic values (e.g. on `hdr + L_METHOD` or `ptr++`) made the const analysis think `ptr` may alias a modified object. The rest of the function is not shown, so a real write through `ptr` cannot be ruled out, which is why confidence is low." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/onnxruntime/onnxruntime_1.27.1+dfsg.orig.tar.xz", "your microsoft-onnxruntime-df2ba1c/onnxruntime/core/providers/qnn/builder/qnn_node_group/channel_shuffle_fusion.cc:254:35: style: Condition 'reshape1_output_dims.size()= 3`, so `input.size() >= 2` and the size_t subtraction cannot wrap. The condition `output.size() < remaining_dims + 3` therefore reduces to `output.size() < output.size()`, which is always false. The new symbolic +/- propagation correctly finds this redundant check, so the warning is a true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/oourafft/oourafft_1.0.orig.tar.gz", "your OouraFFT-1.0/sample2/pi_fft.c:744:5: warning: If memory allocation fails, then there is a possible null pointer dereference: tmpfft [nullPointerOutOfMemory]\n OouraFFT-1.0/sample2/pi_fft.c:91:27: note: Assuming allocation function fails\n OouraFFT-1.0/sample2/pi_fft.c:91:10: note: Assignment 'd1=(double*)malloc((nfft+2)*sizeof(double))', assigned value is 0\n OouraFFT-1.0/sample2/pi_fft.c:94:12: note: Assuming condition is false\n OouraFFT-1.0/sample2/pi_fft.c:102:45: note: Calling function 'mp_mul_radix_test', 4th argument 'd1' value is 0\n OouraFFT-1.0/sample2/pi_fft.c:744:5: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In main(), `d1` is allocated with `malloc` at line 91. The check at line 94 (column 12 matches the `==` in `if (d3 == NULL)`) only tests a later allocation, not `d1`. `d1` is then passed as `tmpfft` to `mp_mul_radix_test`, which writes `tmpfft[nfft + 1]` without any null check. If that allocation fails, this is a real null-pointer dereference, so the new nullPointerOutOfMemory warning is a true positive. It is probably exposed by the new symbolic `+`/`-` value propagation. Not seeing the exact lines 91\u2013102 lowers confidence slightly." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/openms/openms_2.6.0+cleaned1.orig.tar.gz", "your openms-2.6.0+cleaned/src/openms/source/ANALYSIS/ID/ProtonDistributionModel.cpp:801:23: style: Condition 'iy+offset.y()-8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:564:12: note: bottom is assigned '(int)start->y+offset.y()+8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:566:16: note: Condition 'bottomy + offset.y()`. So `bottom` is always `top`+16, and `bottom < top` can only be true through signed int overflow, which is undefined behaviour. The condition really is always false and the swap block is dead defensive code. The PR's new symbolic +/- propagation lets Cppcheck see this, so the new knownConditionTrueFalse warning is a correct true positive, although some users may find it of little practical value." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xdrawchem/xdrawchem_1.11.1.orig.tar.xz", "your xdrawchem-1.11.1/xdrawchem/symbol.cpp:568:9: style: Variable 'top' is assigned an expression that holds the same value. [redundantAssignment]\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:564:12: note: bottom is assigned '(int)start->y+offset.y()+8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:566:16: note: Assuming condition is true\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:568:9: note: Variable 'top' is assigned an expression that holds the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`top` is set to `(int)start->y + offset.y() - 8` and `bottom` to the same base `+ 8`, so the two always differ by 16. The assignment `top = bottom;` inside `if (bottom < top)` therefore does not assign the same value: it would change `top` by 16. The new symbolic +/- propagation in the PR gives `bottom` a wrong symbolic value equal to `top`, which produces this redundantAssignment false positive. The block is actually dead code, but the message's claim that the value is unchanged is wrong." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xdrawchem/xdrawchem_1.11.1.orig.tar.xz", "your xdrawchem-1.11.1/xdrawchem/symbol.cpp:569:9: style: Variable 'bottom' is assigned an expression that holds the same value. [redundantAssignment]\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:562:9: note: top is assigned '(int)start->y+offset.y()-8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:566:16: note: Assuming condition is true\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:567:15: note: Assignment 'swp=top', assigned value is symbolic=(int)start->y+offset.y()-8\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:569:9: note: Variable 'bottom' is assigned an expression that holds the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "At line 569, `bottom` holds start->y+offset.y()+8 and `swp` holds the old `top`, start->y+offset.y()-8. The two values differ by 16, so `bottom = swp` does change `bottom`. The claim that it is 'assigned an expression that holds the same value' is false. The new symbolic +/- offset propagation appears to have lost the offset when matching the values. The whole branch is dead code anyway (the condition is always false), but this particular warning is wrong. It is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xdrawchem/xdrawchem_1.11.1.orig.tar.xz", "your xdrawchem-1.11.1/xdrawchem/symbol.cpp:571:15: style: Condition 'rightx+offset.x()-8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:565:11: note: right is assigned '(int)start->x+offset.x()+8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:571:15: note: Condition 'rightx + offset.x()`. So `right` is always `left + 16`, and `right < left` can never be true (signed overflow would be undefined behaviour). The swap block is dead defensive code. The new symbolic +/- constant propagation lets Cppcheck see this, so the new knownConditionTrueFalse warning is a true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xdrawchem/xdrawchem_1.11.1.orig.tar.xz", "your xdrawchem-1.11.1/xdrawchem/symbol.cpp:573:9: style: Variable 'left' is assigned an expression that holds the same value. [redundantAssignment]\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:565:11: note: right is assigned '(int)start->x+offset.x()+8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:571:15: note: Assuming condition is true\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:573:9: note: Variable 'left' is assigned an expression that holds the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "Here `left = X - 8` and `right = X + 8` (with `X = (int)start->x + offset.x()`). Inside `if (right < left)`, the statement `left = right;` would change `left` by 16, so it does not assign 'the same value'. The new symbolic +/- propagation in the pull request apparently mismatches the offsets and wrongly treats `left` and `right` as equal. That branch is actually dead code, which the separate knownConditionTrueFalse warning covers, but the redundantAssignment message is factually wrong. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xdrawchem/xdrawchem_1.11.1.orig.tar.xz", "your xdrawchem-1.11.1/xdrawchem/symbol.cpp:574:9: style: Variable 'right' is assigned an expression that holds the same value. [redundantAssignment]\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:563:10: note: left is assigned '(int)start->x+offset.x()-8' here.\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:571:15: note: Assuming condition is true\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:572:15: note: Assignment 'swp=left', assigned value is symbolic=(int)start->x+offset.x()-8\n xdrawchem-1.11.1/xdrawchem/symbol.cpp:574:9: note: Variable 'right' is assigned an expression that holds the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`right` is `(int)start->x+offset.x()+8` and `swp` is `left`, which is `(int)start->x+offset.x()-8`. The two values differ by 16, so `right = swp` is not a same-value assignment, and the message is wrong. The branch is dead anyway: the separate knownConditionTrueFalse warning for `right