Skip to content

HeapBlock Convert now honours unsigned parameter#3350

Merged
josesimoes merged 1 commit into
nanoframework:developfrom
josesimoes:fix-unsigned-cast
May 8, 2026
Merged

HeapBlock Convert now honours unsigned parameter#3350
josesimoes merged 1 commit into
nanoframework:developfrom
josesimoes:fix-unsigned-cast

Conversation

@josesimoes
Copy link
Copy Markdown
Member

Description

  • When dealing with unsigned, change data type to unsigned ones.

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

@josesimoes josesimoes added the Area: Common libs Everything related with common libraries label May 7, 2026
@nfbot nfbot added the Type: bug label May 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 28d4b09a-05a1-4e0f-8119-ea8dcc058303

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca760b and d24c2e6.

📒 Files selected for processing (1)
  • src/CLR/Include/nanoCLR_Runtime__HeapBlock.h

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved unsigned integer type conversion handling to ensure proper remapping of integer data types during conversion operations. This fix ensures unsigned values are correctly processed in type conversion scenarios, enhancing the reliability of integer conversion logic.

Walkthrough

This PR adds type remapping logic to the CLR_RT_HeapBlock::Convert method. When the fUnsigned flag is set, the method now remaps signed integer data types (I1, I2, I4, I8) to their unsigned counterparts (U1, U2, U4, U8) before performing the conversion operation.

Changes

Unsigned Type Conversion Fix

Layer / File(s) Summary
Type Remapping Logic
src/CLR/Include/nanoCLR_Runtime__HeapBlock.h
CLR_RT_HeapBlock::Convert conditionally remaps signed integer types to unsigned equivalents when fUnsigned flag is set, via a switch statement before calling Convert_Internal.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: making HeapBlock Convert honor the unsigned parameter by remapping signed data types to unsigned variants.
Description check ✅ Passed The description clearly relates to the changeset, explaining that unsigned values now use unsigned data types and referencing the bug fix for issue #1735.
Linked Issues check ✅ Passed The PR addresses the objective in #1735 by fixing the unsigned-to-double conversion behavior through proper data type remapping in HeapBlock Convert.
Out of Scope Changes check ✅ Passed All changes are limited to the HeapBlock Convert method implementation and directly support the bug fix objective of handling unsigned values correctly.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@josesimoes josesimoes force-pushed the fix-unsigned-cast branch from 65ce175 to 93fec6e Compare May 7, 2026 11:27
- When dealing with unsigned, change data type to unsigned ones.
@josesimoes josesimoes force-pushed the fix-unsigned-cast branch from 93fec6e to d24c2e6 Compare May 8, 2026 15:37
@josesimoes
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@josesimoes josesimoes merged commit 623d1ad into nanoframework:develop May 8, 2026
23 checks passed
@josesimoes josesimoes deleted the fix-unsigned-cast branch May 8, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Common libs Everything related with common libraries Type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants