From 4763ada0753141eee27357a4b60debf976926d96 Mon Sep 17 00:00:00 2001 From: Ivan Gulakov Date: Sat, 17 May 2025 00:13:31 +0200 Subject: [PATCH] Use is_multiple_of instead of % == 0 (#3244) I was reading the changelog of 1.87 and noticed that it's stable now. Realised that I saw a todo in the code :) https://releases.rs/docs/1.87.0/ --- libafl_intelpt/src/linux.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libafl_intelpt/src/linux.rs b/libafl_intelpt/src/linux.rs index 760ce98e49..2f73f4ef1d 100644 --- a/libafl_intelpt/src/linux.rs +++ b/libafl_intelpt/src/linux.rs @@ -724,8 +724,7 @@ impl IntelPTBuilder { /// Set the size of the perf aux buffer (actual PT traces buffer) pub fn perf_aux_buffer_size(mut self, perf_aux_buffer_size: usize) -> Result { - // todo:replace with is_multiple_of once stable - if perf_aux_buffer_size % PAGE_SIZE != 0 { + if !perf_aux_buffer_size.is_multiple_of(PAGE_SIZE) { return Err(Error::illegal_argument( "IntelPT perf_aux_buffer must be page aligned", ));