[SERVER-55517] Coverity analysis defect 117933: Logically dead code Created: 25/Mar/21  Updated: 29/Oct/23  Resolved: 31/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Andrii Dobroshynski (Inactive)
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query Execution 2021-04-05
Participants:

 Description   

Logically dead code

The indicated dead code may have performed some action; that action will never occur. Code can never be reached because of a logical contradiction
/src/mongo/db/exec/sbe/parser/parser.cpp:1128: DEADCODE 117933 Assigning: "foldPos" = "4UL".
/src/mongo/db/exec/sbe/parser/parser.cpp:1133: DEADCODE 117933 Assigning: "foldPos" = "3UL".
/src/mongo/db/exec/sbe/parser/parser.cpp:1145: DEADCODE 117933 At condition "foldPos", the value of "foldPos" must be between 3 and 4.
/src/mongo/db/exec/sbe/parser/parser.cpp:1138: DEADCODE 117933 The condition "foldPos" must be true.
/src/mongo/db/exec/sbe/parser/parser.cpp:1138: DEADCODE 117933 Execution cannot reach this statement: "<temporary>.unique_ptr(std:...".



 Comments   
Comment by Githook User [ 31/Mar/21 ]

Author:

{'name': 'Andrii Dobroshynski', 'email': 'andrii.dobroshynski@mongodb.com', 'username': 'dobroshynski'}

Message: SERVER-55517 Remove unnecessary check for positions in parser
Branch: master
https://github.com/mongodb/mongo/commit/7204fabf24cb0da66f4ac6507fca49d2fef1e669

Generated at Thu Feb 08 05:36:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.