Skip to content
Commit 43ff058e authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[llvm-objcopy] IHexELFBuilder::addDataSections - fix evaluation ordering static analyzer warning

As detailed on https://pvs-studio.com/en/blog/posts/cpp/0771/ and raised on D62583, the SecNo++ increment is not guaranteed to occur before the second use of SecNo in the same addSection() call.

This patch pulls out the increment (just for clarity) and replaces the second use of SecNo with a constant zero value (we're using stable_sort so the value isn't critical).

Differential Revision: https://reviews.llvm.org/D107273
parent e4dee762
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment