mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Use StringView when parsing pledges in sys$pledge(..)
This ensures no potential allocation as in some cases the pledge char* could be promoted to AK::String by the compiler to execute the comparison.
This commit is contained in:
parent
c2282ee28d
commit
9d8482c3e8
Notes:
sideshowbarker
2024-07-18 08:28:54 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/9d8482c3e8f Pull-request: https://github.com/SerenityOS/serenity/pull/8963
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ KResultOr<FlatPtr> Process::sys$pledge(Userspace<const Syscall::SC_pledge_params
|
|||
auto parts = pledge_spec.split_view(' ');
|
||||
for (auto& part : parts) {
|
||||
#define __ENUMERATE_PLEDGE_PROMISE(x) \
|
||||
if (part == #x) { \
|
||||
if (part == StringView { #x }) { \
|
||||
mask |= (1u << (u32)Pledge::x); \
|
||||
continue; \
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue