[SERVER-74537] Coverity analysis defect 135326: Bad bit shift operation Created: 02/Mar/23  Updated: 27/Oct/23  Resolved: 07/Mar/23

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

Type: Bug Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Svilen Mihaylov (Inactive)
Resolution: Works as Designed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Operating System: ALL
Participants:

 Description   

Bad bit shift operation

The operation may have an undefined behavior or yield an unexpected result. A bit shift operation has a shift amount which is too large or has a negative value.
/src/mongo/db/query/optimizer/cascades/logical_rewriter.cpp:1346: BAD_SHIFT 135326 Assigning: "reqSize" = "reqMap->numConjuncts()". The value of "reqSize" is now 0.
/src/mongo/db/query/optimizer/cascades/logical_rewriter.cpp:1347: BAD_SHIFT 135326 In expression "1ULL << reqSize - 1UL", shifting by a negative amount has undefined behavior. The shift amount, "reqSize - 1UL", is -1.



 Comments   
Comment by Eric Milkie [ 07/Mar/23 ]

Yes, you can just close these Jira tickets like this.

Generated at Thu Feb 08 06:27:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.