Skip to content

BUG: Fix MeshIOBase component types of signed char and plain char - #7241

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
domibel:meshiobase-signed-char
Nov 26, 2026
Merged

hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
domibel:meshiobase-signed-char

Conversation

@domibel

@domibel domibel commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

MapComponentType returned UNKNOWNCOMPONENTTYPE for signed char, and CHAR for plain char even where it is unsigned (e.g. arm64).

A new itkMeshIOBaseGTest checks the mapping of each type at compile time.

@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:IO Issues affecting the IO module labels Nov 26, 2026
@greptile-apps

greptile-apps Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

security Security Review

This PR appears safe to merge from a security standpoint.

What was checked
  • The changed type mapping only moves 1-byte component types (char, signed char, unsigned char between CHAR/SCHAR and UCHAR), and GetComponentSize returns 1 for all of them, so buffer allocations and read offsets in MeshFileReader are unchanged.
  • The old behavior mapped signed char to UNKNOWNCOMPONENTTYPE, which GetComponentSize rejects with an exception rather than an unsafe size, so the fix removes a failure path rather than adding one.
  • The new test file itkMeshIOBaseGTest.cxx is compile-time static_assert checks only and parses no input.
  • The CMakeLists.txt change only registers the new test source with the existing Google Test driver.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Corrects MeshIOBase::MapComponentType for character types.

  • Mesh IO maps byte types by their signedness.

No actionable issues found. Build and tests were not run.

Reviews (1) · Last reviewed commit: "BUG: Fix MeshIOBase component types of s..." · Reviewed by Greptile

MapComponentType returned UNKNOWNCOMPONENTTYPE for `signed char`, and
CHAR for plain `char` even where it is unsigned (e.g. arm64).

A new itkMeshIOBaseGTest checks the mapping of each type at compile time.
@domibel
domibel force-pushed the meshiobase-signed-char branch from 515c05d to 9d5e84d Compare November 26, 2026 03:05
@hjmjohnson
hjmjohnson merged commit 16f9898 into InsightSoftwareConsortium:main Nov 26, 2026
19 checks passed
@domibel
domibel deleted the meshiobase-signed-char branch November 27, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants