onnxruntime/onnxruntime
Edward Chen d5338da1f5
Fix tensor external data info length parsing issue. (#23526)
Fix tensor external data info length parsing issue.

The old implementation was parsing a `size_t` value with `strtol` (via `OrtStrToPtrDiff`) on ARM64 MSVC.

bf023ab3d5/onnxruntime/core/platform/path_lib.h (L74)

If we have `sizeof(size_t) == 8` and `sizeof(long) == 4` (as is the case for x64 and ARM64 MSVC), `strtol` will return a maximum value of `2^31-1` even for a larger, valid `size_t` value. `strtol` will also set `errno` to `ERANGE`, but we weren't checking that.

Updated to use `ParseStringWithClassicLocale` which will parse directly to the target type.

Added some tests.
2025-01-29 13:35:25 -08:00
..
contrib_ops [ARM CPU] hgemm optimized for gqa (#23107) 2025-01-24 15:25:24 -08:00
core Fix tensor external data info length parsing issue. (#23526) 2025-01-29 13:35:25 -08:00
lora Accomodate BE platforms. Make sure we always write flatbuffers LE (#22375) 2024-10-11 09:14:44 -07:00
python Fix shape infer of onnx GroupNorm (#23477) 2025-01-25 23:41:29 -08:00
test Fix tensor external data info length parsing issue. (#23526) 2025-01-29 13:35:25 -08:00
tool/etw
wasm [WebNN] Fixed WebNN Module undefined issue (#22795) 2024-11-11 21:31:24 -08:00
__init__.py Use ruff as the formatter to replace black-isort (#23397) 2025-01-16 11:14:15 -08:00
ReformatSource.ps1
ReformatSourcePython.bat
VSCodeCoverage.runsettings