SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Fix int overflow in useRawPropsJsiValue (#53504)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53504

Casting directly from double to int loses precision. Instead, match the (accidental) behaviour of the folly version, which always access the value as an int64_t first.

```
double value = 4294967040
(int)value = 2147483647 (overflow)
(int)(int64_t)value = -256 (signed version of 4294967040)
```

Changelog: [General][Fixed] Casting rawValue to int was incorrectly truncating

Reviewed By: zeyap, sammy-SC

Differential Revision: D81228983

fbshipit-source-id: d68d4e63d7c7bc9a9226592756a1e53666d58978
P
Pieter De Baets committed
31b9f103645e67586bdfc5c2f590c28c04ca3871
Parent: c05f39e
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/28/2025, 5:04:07 PM