From 9f3107d81296a2d1d0f3e6b079b4ade2b4dd9cc9 Mon Sep 17 00:00:00 2001 From: angie Date: Tue, 23 Apr 2024 11:09:58 -0400 Subject: [PATCH 1/6] misc_expandJalr --- CHANGELOG.md | 9 +++++++-- Cargo.toml | 2 +- README.md | 10 +++++++--- include/common/RabbitizerConfig.h | 1 + pyproject.toml | 2 +- rabbitizer/Config.pyi | 1 + rabbitizer/rabbitizer_global_config.c | 2 ++ src/common/RabbitizerConfig.c | 1 + .../RabbitizerInstructionCpu_OperandType.c | 2 +- 9 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b309c9b..12f96be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- New global configuration: + - `misc_expandJalr`: If `True` then `jalr` instructions will be always emitted + with two operands. Otherwise the `rd` register will be omitted if it is + `$ra` and will be used explicitly if it isn't `$ra`. Defaults to `False`. + ## [1.10.0] - 2024-04-22 ### Added @@ -566,8 +573,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.0] - 2022-07-07 -### Uncategorized - ### Added - New classes: diff --git a/Cargo.toml b/Cargo.toml index f281bef1..12d21bb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "rabbitizer" # Version should be synced with include/common/RabbitizerVersion.h -version = "1.10.0" +version = "1.10.1" edition = "2021" authors = ["Anghelo Carvajal "] description = "MIPS instruction decoder" diff --git a/README.md b/README.md index d392ca02..2c759ca9 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,13 @@ MIPS instruction decoder API. doesn't allocate in anything in the heap by itself. - Other language bindings supported in this repo: - Python bindings - - The minimal Python version is 3.7, older versions are not guaranteed to work. + - The minimal Python version is 3.7, older versions are not guaranteed to + work. - C++ bindings - Rust bindings - Simple per-word instruction decoding. - The library doesn't try to be too smart by processing multiple instructions - at a time. + at a time. - Can perform validation checks for instructions. - Provides many examination/grouping functions for instructions, allowing to simplify checking characteristics of an instruction and minimizing the need to @@ -30,6 +31,9 @@ MIPS instruction decoder API. - Includes some minor tools to build your own pointer/symbol detection. - Configurable, many features can be turned on and off. - MIPS instructions features: + - Configurable behavior for the `jalr` instruction, allowing to disassemble + that instruction using an implicit or explicit `rd` register depending if + that register is `$ra` or not. - Named registers for MIPS VR4300's coprocessors. - Support for many pseudo-instructions. - Properly handle move to/from coprocessor instructions. @@ -65,7 +69,7 @@ If you use a `requirements.txt` file in your repository, then you can add this library with the following line: ```txt -rabbitizer>=1.10.0,<2.0.0 +rabbitizer>=1.10.1,<2.0.0 ``` ### Development version diff --git a/include/common/RabbitizerConfig.h b/include/common/RabbitizerConfig.h index b74cb81f..8ab3c98d 100644 --- a/include/common/RabbitizerConfig.h +++ b/include/common/RabbitizerConfig.h @@ -63,6 +63,7 @@ typedef struct RabbitizerConfig_Misc { bool unknownInstrComment; // Generate a pseudo-disassembly comment when disassembling non implemented instructions bool omit0XOnSmallImm; bool upperCaseImm; + bool expandJalr; } RabbitizerConfig_Misc; typedef struct RabbitizerConfig { diff --git a/pyproject.toml b/pyproject.toml index e739aed6..2e468d73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [project] name = "rabbitizer" # Version should be synced with include/common/RabbitizerVersion.h -version = "1.10.0" +version = "1.10.1" description = "MIPS instruction decoder" # license = "MIT" readme = "README.md" diff --git a/rabbitizer/Config.pyi b/rabbitizer/Config.pyi index 94da2013..8f57ecc0 100644 --- a/rabbitizer/Config.pyi +++ b/rabbitizer/Config.pyi @@ -35,5 +35,6 @@ class _RabbitizerConfig: misc_unknownInstrComment: bool = True misc_omit0XOnSmallImm: bool = False misc_upperCaseImm: bool = True + misc_expandJalr: bool = False config: _RabbitizerConfig diff --git a/rabbitizer/rabbitizer_global_config.c b/rabbitizer/rabbitizer_global_config.c index b210a568..46c64987 100644 --- a/rabbitizer/rabbitizer_global_config.c +++ b/rabbitizer/rabbitizer_global_config.c @@ -126,6 +126,7 @@ DEF_MEMBER_GET_SET_INT(misc, opcodeLJust, false, 0, 0) DEF_MEMBER_GET_SET_BOOL(misc, unknownInstrComment) DEF_MEMBER_GET_SET_BOOL(misc, omit0XOnSmallImm) DEF_MEMBER_GET_SET_BOOL(misc, upperCaseImm) +DEF_MEMBER_GET_SET_BOOL(misc, expandJalr) static PyGetSetDef rabbitizer_global_config_GetSets[] = { @@ -155,6 +156,7 @@ static PyGetSetDef rabbitizer_global_config_GetSets[] = { MEMBER_GET_SET(misc, unknownInstrComment, "", NULL), MEMBER_GET_SET(misc, omit0XOnSmallImm, "", NULL), MEMBER_GET_SET(misc, upperCaseImm, "", NULL), + MEMBER_GET_SET(misc, expandJalr, "", NULL), { 0 }, }; diff --git a/src/common/RabbitizerConfig.c b/src/common/RabbitizerConfig.c index 2d0e83a2..827e175a 100644 --- a/src/common/RabbitizerConfig.c +++ b/src/common/RabbitizerConfig.c @@ -49,5 +49,6 @@ RabbitizerConfig RabbitizerConfig_Cfg = { .unknownInstrComment = true, .omit0XOnSmallImm = false, .upperCaseImm = true, + .expandJalr = false, } }; diff --git a/src/instructions/RabbitizerInstructionCpu/RabbitizerInstructionCpu_OperandType.c b/src/instructions/RabbitizerInstructionCpu/RabbitizerInstructionCpu_OperandType.c index 9b4540d0..5b340c0c 100644 --- a/src/instructions/RabbitizerInstructionCpu/RabbitizerInstructionCpu_OperandType.c +++ b/src/instructions/RabbitizerInstructionCpu/RabbitizerInstructionCpu_OperandType.c @@ -291,7 +291,7 @@ size_t RabbitizerOperandType_process_cpu_maybe_rd_rs(const RabbitizerInstruction uint8_t rd = RAB_INSTR_GET_rd(self); const RabbitizerRegisterDescriptor *regDescriptor = RabbitizerRegister_getDescriptor_Gpr(rd); - if (!RabbitizerRegisterDescriptor_isRa(regDescriptor)) { + if (!RabbitizerRegisterDescriptor_isRa(regDescriptor) || RabbitizerConfig_Cfg.misc.expandJalr) { RABUTILS_BUFFER_ADVANCE(dst, totalSize, RabbitizerOperandType_process_cpu_rd(self, dst, immOverride, immOverrideLength)); From d3669aac76373127f7636b087abc8d574ea44b1d Mon Sep 17 00:00:00 2001 From: angie Date: Mon, 20 May 2024 09:44:22 -0400 Subject: [PATCH 2/6] Fix test --- include/common/RabbitizerVersion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/common/RabbitizerVersion.h b/include/common/RabbitizerVersion.h index 764a7e0d..de99cee7 100644 --- a/include/common/RabbitizerVersion.h +++ b/include/common/RabbitizerVersion.h @@ -14,7 +14,7 @@ extern "C" { // Header version #define RAB_VERSION_MAJOR 1 #define RAB_VERSION_MINOR 10 -#define RAB_VERSION_PATCH 0 +#define RAB_VERSION_PATCH 1 #define RAB_VERSION_STR RAB_STRINGIFY(RAB_VERSION_MAJOR) "." RAB_STRINGIFY(RAB_VERSION_MINOR) "." RAB_STRINGIFY(RAB_VERSION_PATCH) From f5c65d02d1c41066bcf04abc8cc672f2cd2a029c Mon Sep 17 00:00:00 2001 From: angie Date: Wed, 22 May 2024 12:26:29 -0400 Subject: [PATCH 3/6] Fix Rust 1.78 crash due to new `slice.get_unchecked` behavior --- CHANGELOG.md | 6 ++ rust/src/registers_methods.rs | 135 +++++++++++++++++++++++++++------- 2 files changed, 116 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12f96be9..6617c45c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 with two operands. Otherwise the `rd` register will be omitted if it is `$ra` and will be used explicitly if it isn't `$ra`. Defaults to `False`. +### Fixed + +- Fix crash in Rust bindings for to Rust 1.78. + - This happens because `slice.get_unchecked` now performs OoB checks in debug + builds, which is is triggered when trying to dereference unsized C arrays. + ## [1.10.0] - 2024-04-22 ### Added diff --git a/rust/src/registers_methods.rs b/rust/src/registers_methods.rs index 8617e00a..9cf7c63d 100644 --- a/rust/src/registers_methods.rs +++ b/rust/src/registers_methods.rs @@ -110,7 +110,11 @@ impl registers_enum::registers::GprO32 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_GprO32_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_GprO32_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -128,7 +132,11 @@ impl registers_enum::registers::GprN32 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_GprN32_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_GprN32_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -146,7 +154,11 @@ impl registers_enum::registers::Cop0 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_Cop0_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_Cop0_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -164,7 +176,11 @@ impl registers_enum::registers::Cop1O32 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_Cop1O32_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_Cop1O32_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -182,7 +198,11 @@ impl registers_enum::registers::Cop1N32 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_Cop1N32_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_Cop1N32_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -200,7 +220,11 @@ impl registers_enum::registers::Cop1N64 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_Cop1N64_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_Cop1N64_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -218,7 +242,11 @@ impl registers_enum::registers::Cop1Control { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_Cop1Control_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_Cop1Control_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -236,7 +264,11 @@ impl registers_enum::registers::Cop2 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_Cop2_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_Cop2_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -254,7 +286,11 @@ impl registers_enum::registers::RspGpr { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_RspGpr_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_RspGpr_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -272,7 +308,11 @@ impl registers_enum::registers::RspCop0 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_RspCop0_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_RspCop0_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -290,7 +330,11 @@ impl registers_enum::registers::RspCop2 { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_RspCop2_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_RspCop2_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -308,7 +352,11 @@ impl registers_enum::registers::RspCop2Control { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_RspCop2Control_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_RspCop2Control_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -326,7 +374,11 @@ impl registers_enum::registers::RspVector { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_RspVector_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_RspVector_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -344,7 +396,11 @@ impl registers_enum::registers::R4000AllegrexS { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_R4000AllegrexS_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_R4000AllegrexS_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -364,7 +420,11 @@ impl registers_enum::registers::R4000AllegrexV2D { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_R4000AllegrexV2D_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_R4000AllegrexV2D_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -384,7 +444,11 @@ impl registers_enum::registers::R4000AllegrexV3D { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_R4000AllegrexV3D_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_R4000AllegrexV3D_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -404,7 +468,11 @@ impl registers_enum::registers::R4000AllegrexV4D { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_R4000AllegrexV4D_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_R4000AllegrexV4D_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -425,7 +493,9 @@ impl registers_enum::registers::R4000AllegrexM2x2 { let reg_value: u32 = (*self).into(); unsafe { - RabbitizerRegister_R4000AllegrexM2x2_Descriptors.get_unchecked(reg_value as usize) + &*RabbitizerRegister_R4000AllegrexM2x2_Descriptors + .as_ptr() + .offset(reg_value as isize) } } } @@ -447,7 +517,9 @@ impl registers_enum::registers::R4000AllegrexM3x3 { let reg_value: u32 = (*self).into(); unsafe { - RabbitizerRegister_R4000AllegrexM3x3_Descriptors.get_unchecked(reg_value as usize) + &*RabbitizerRegister_R4000AllegrexM3x3_Descriptors + .as_ptr() + .offset(reg_value as isize) } } } @@ -469,7 +541,9 @@ impl registers_enum::registers::R4000AllegrexM4x4 { let reg_value: u32 = (*self).into(); unsafe { - RabbitizerRegister_R4000AllegrexM4x4_Descriptors.get_unchecked(reg_value as usize) + &*RabbitizerRegister_R4000AllegrexM4x4_Descriptors + .as_ptr() + .offset(reg_value as isize) } } } @@ -491,8 +565,9 @@ impl registers_enum::registers::R4000AllegrexVfpuControl { let reg_value: u32 = (*self).into(); unsafe { - RabbitizerRegister_R4000AllegrexVfpuControl_Descriptors - .get_unchecked(reg_value as usize) + &*RabbitizerRegister_R4000AllegrexVfpuControl_Descriptors + .as_ptr() + .offset(reg_value as isize) } } } @@ -514,7 +589,9 @@ impl registers_enum::registers::R4000AllegrexVConstant { let reg_value: u32 = (*self).into(); unsafe { - RabbitizerRegister_R4000AllegrexVConstant_Descriptors.get_unchecked(reg_value as usize) + &*RabbitizerRegister_R4000AllegrexVConstant_Descriptors + .as_ptr() + .offset(reg_value as isize) } } } @@ -533,7 +610,11 @@ impl registers_enum::registers::R5900VF { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_R5900VF_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_R5900VF_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } @@ -549,6 +630,10 @@ impl registers_enum::registers::R5900VI { pub fn descriptor(&self) -> &RegisterDescriptor { let reg_value: u32 = (*self).into(); - unsafe { RabbitizerRegister_R5900VI_Descriptors.get_unchecked(reg_value as usize) } + unsafe { + &*RabbitizerRegister_R5900VI_Descriptors + .as_ptr() + .offset(reg_value as isize) + } } } From 4dd2a55588820eeb6b3e61569a7762ca11e608ac Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 22 May 2024 10:33:15 -0600 Subject: [PATCH 4/6] Fix heap corruption in Rust bindings (#62) RabbitizerInstruction_getSizeForBuffer and RabbitizerOperandType_getBufferSize return the size _without_ the null terminator, so we need to allocate one more byte to avoid writing past the allocated vector bounds. --- rust/src/instruction.rs | 2 +- rust/src/opereand_type.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/src/instruction.rs b/rust/src/instruction.rs index d8a81bdf..f300c2a1 100644 --- a/rust/src/instruction.rs +++ b/rust/src/instruction.rs @@ -709,7 +709,7 @@ impl Instruction { let buffer_size = RabbitizerInstruction_getSizeForBuffer(self, imm_override_len, extra_l_just); - let mut buffer: Vec = vec![0; buffer_size]; + let mut buffer: Vec = vec![0; buffer_size + 1]; let disassembled_size = RabbitizerInstruction_disassemble( self, buffer.as_mut_ptr() as *mut core::ffi::c_char, diff --git a/rust/src/opereand_type.rs b/rust/src/opereand_type.rs index 1935d832..fc9c5e92 100644 --- a/rust/src/opereand_type.rs +++ b/rust/src/opereand_type.rs @@ -30,7 +30,7 @@ impl operand_type_enum::OperandType { unsafe { let buffer_size = RabbitizerOperandType_getBufferSize(*self, instr, imm_override_len); - let mut buffer: Vec = vec![0; buffer_size]; + let mut buffer: Vec = vec![0; buffer_size + 1]; let disassembled_size = RabbitizerOperandType_disassemble( *self, instr, From b284f11232f964329078bbb798659677fd82e375 Mon Sep 17 00:00:00 2001 From: angie Date: Wed, 22 May 2024 12:49:08 -0400 Subject: [PATCH 5/6] version bump --- CHANGELOG.md | 3 +++ Cargo.toml | 2 +- README.md | 4 ++-- include/common/RabbitizerVersion.h | 4 ++-- pyproject.toml | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6617c45c..bd8df0dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.11.0] - 2024-05-22 + ### Added - New global configuration: @@ -612,6 +614,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First version [unreleased]: https://github.com/Decompollaborate/rabbitizer/compare/master...develop +[1.11.0]: https://github.com/Decompollaborate/rabbitizer/compare/1.10.0...1.11.0 [1.10.0]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.5...1.10.0 [1.9.5]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.4...1.9.5 [1.9.4]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.3...1.9.4 diff --git a/Cargo.toml b/Cargo.toml index 12d21bb7..dfd18e31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "rabbitizer" # Version should be synced with include/common/RabbitizerVersion.h -version = "1.10.1" +version = "1.11.0" edition = "2021" authors = ["Anghelo Carvajal "] description = "MIPS instruction decoder" diff --git a/README.md b/README.md index 2c759ca9..9cf3dc04 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ If you use a `requirements.txt` file in your repository, then you can add this library with the following line: ```txt -rabbitizer>=1.10.1,<2.0.0 +rabbitizer>=1.11.0,<2.0.0 ``` ### Development version @@ -109,7 +109,7 @@ cargo add rabbitizer Or you can add it manually to your `Cargo.toml`: ```toml -rabbitizer = "1.10.0" +rabbitizer = "1.11.0" ``` See this crate at . diff --git a/include/common/RabbitizerVersion.h b/include/common/RabbitizerVersion.h index de99cee7..6658799e 100644 --- a/include/common/RabbitizerVersion.h +++ b/include/common/RabbitizerVersion.h @@ -13,8 +13,8 @@ extern "C" { // Header version #define RAB_VERSION_MAJOR 1 -#define RAB_VERSION_MINOR 10 -#define RAB_VERSION_PATCH 1 +#define RAB_VERSION_MINOR 11 +#define RAB_VERSION_PATCH 0 #define RAB_VERSION_STR RAB_STRINGIFY(RAB_VERSION_MAJOR) "." RAB_STRINGIFY(RAB_VERSION_MINOR) "." RAB_STRINGIFY(RAB_VERSION_PATCH) diff --git a/pyproject.toml b/pyproject.toml index 2e468d73..960aea61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [project] name = "rabbitizer" # Version should be synced with include/common/RabbitizerVersion.h -version = "1.10.1" +version = "1.11.0" description = "MIPS instruction decoder" # license = "MIT" readme = "README.md" From 7b51c84250e839680c8d53cedb791c686bcd64ec Mon Sep 17 00:00:00 2001 From: angie Date: Wed, 22 May 2024 12:51:21 -0400 Subject: [PATCH 6/6] Mention heap corruption fix in the CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd8df0dd..1b59f9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix crash in Rust bindings for to Rust 1.78. - This happens because `slice.get_unchecked` now performs OoB checks in debug builds, which is is triggered when trying to dereference unsized C arrays. +- Fix heap corruption in Rust bindings (#62) + - The C API was returning string sizes without accounting for the null + terminator, which produced issues on the Rust size which was not manually + including it. ## [1.10.0] - 2024-04-22