Skip to content

Commit c4d72e5

Browse files
committed
C++: No need to check if the offset is non-negative. It always is because of 'defBlock.getInstruction(oldOffset)' has a result.
1 parent cf8b2d5 commit c4d72e5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,10 +712,7 @@ module DefUse {
712712
OldBlock defBlock, int defOffset, Alias::MemoryLocation defLocation,
713713
Alias::MemoryLocation actualDefLocation
714714
) {
715-
exists(OldInstruction oldInstr, int oldOffset |
716-
oldInstr = defBlock.getInstruction(oldOffset) and
717-
oldOffset >= 0
718-
|
715+
exists(OldInstruction oldInstr, int oldOffset | oldInstr = defBlock.getInstruction(oldOffset) |
719716
// An odd offset corresponds to the `Chi` instruction.
720717
defOffset = getChiOffset(oldOffset, defBlock) and
721718
result = getChi(oldInstr) and

0 commit comments

Comments
 (0)