fix: enforce const-correctness in indexed_vector#3736
fix: enforce const-correctness in indexed_vector#3736vietcgi wants to merge 1 commit intofalcosecurity:masterfrom
Conversation
Signed-off-by: Kevin Vu <vietcgi@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vietcgi The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped. Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION. /hold |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh with Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with Provide feedback via https://github.com/falcosecurity/community. /lifecycle stale |
|
/remove-lifecycle stale |
|
Hey, thank you for this contribution. I took the liberty of restoring the original PR template while keeping your content. Please use it for your next contribution 🙏 |
|
/close |
|
@ekoops: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/reopen |
|
@ekoops: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
False positive |
|
Hey. Unfortunately, it looks like you need to fix the code formatting. You can configure pre-commit for it: thank to the pre-commit configuration in this repo, it will automatically format your code contextually to commit creation |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
Const
at()methods were returning mutable pointers via const_cast, violating const-correctness.Solution:
at()methods into const/non-const overloadsconst T*, non-const returnsT*Changes:
indexed_vector.h: Added const/non-const overloads for bothat()methodsrule_loader_compiler.cpp: Updated helper functions to return const pointersVerified compilation and all call sites handle const-correctness properly.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: