From 6993da2262995f1e76c46f2b89415afba5207339 Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Fri, 6 Feb 2026 09:18:25 +0000 Subject: [PATCH 1/2] tests: Remove trailing spaces Signed-off-by: Quentin Monnet --- tests/ubpf_jit_x86_64.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ubpf_jit_x86_64.rs b/tests/ubpf_jit_x86_64.rs index 42c7a4e6b..323187b95 100644 --- a/tests/ubpf_jit_x86_64.rs +++ b/tests/ubpf_jit_x86_64.rs @@ -895,7 +895,7 @@ fn test_jit_div_reg_with_nonzero_imm() { // exit 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ]; - + let mut vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); #[cfg(not(feature = "std"))] let mut exec_mem = alloc_exec_memory(); @@ -923,7 +923,7 @@ fn test_jit_mod_reg_with_nonzero_imm() { // exit 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ]; - + let mut vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); #[cfg(not(feature = "std"))] let mut exec_mem = alloc_exec_memory(); From 73c2b6431bf2c5350ad379de8f18695b3965abdc Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Fri, 6 Feb 2026 09:20:31 +0000 Subject: [PATCH 2/2] Cargo.toml,README.md: Bump version to 0.4.1 Bug fixes: - Fix integer overflow in local function calls by using checked arithmetic for call offsets. Previously, certain call offset values could cause an integer overflow/underflow. - Fix 32-bit ALU operations (ADD32, SUB32, MUL32) to properly zero-extend results. The result is now correctly cast to u32 before extending to u64. - Replace unimplemented!() panics with proper error messages for unsupported instructions (XADD, TAIL_CALL), preventing unexpected panics during execution. - In the x86_64 JIT compiler, fix divisor handling in emit_muldivmod: the JIT now correctly uses the is_reg flag to determine whether the divisor is in a register or an immediate value, rather than checking if imm != 0. (These notes were mostly generated from the Git history by Claude Code.) Signed-off-by: Quentin Monnet --- Cargo.toml | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index acdce48f6..ebfb45563 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ # Project metadata name = "rbpf" -version = "0.4.0" +version = "0.4.1" authors = ["Quentin Monnet "] # Additional metadata for packaging diff --git a/README.md b/README.md index 1c47763e9..47f722aeb 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ file: ```toml [dependencies] -rbpf = "0.4.0" +rbpf = "0.4.1" ``` You can also use the development version from this GitHub repository. This @@ -388,7 +388,7 @@ to your `Cargo.toml` file. ```toml [dependencies] -rbpf = "0.4.0" +rbpf = "0.4.1" elf = "0.8.0" ``` @@ -581,7 +581,7 @@ enabled-by-default features. ```toml [dependencies] -rbpf = { version = "0.4.0", default-features = false } +rbpf = { version = "0.4.1", default-features = false } ``` Note that when using this crate in `no_std` environments, the `jit` module