Skip to content

Fix failed typed casts without changing the original value - #956

Closed
guptapratykshh wants to merge 1 commit into
metacall:developfrom
guptapratykshh:fix/933-safe-value-casts
Closed

guptapratykshh wants to merge 1 commit into
metacall:developfrom
guptapratykshh:fix/933-safe-value-casts

Conversation

@guptapratykshh

@guptapratykshh guptapratykshh commented Nov 11, 2026 •

Copy link
Copy Markdown

Description

I fixed the typed metacall_value_cast_* helpers so an unsupported cast returns 0 or NULL without reading the original value as the requested type. The original value remains available to the caller. I added a regression test for failed string-to-int and string-to-pointer casts. No new dependencies.

Fixes #933

@guptapratykshh
guptapratykshh marked this pull request as ready for review November 11, 2026 19:40
@viferga

viferga commented Nov 12, 2026

Copy link
Copy Markdown
Member

I'm not gonna review anything that has not been discussed.

@viferga viferga closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

## 🐛 Bug Report: Missing null check in metacall_value_cast_* causes memory reinterpretation on unsupported casts(e.g returns little endian)

2 participants