Skip to content

[SR-15480] Parsing integer with ParseableFormatStyle crashes #3944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
swift-ci opened this issue Nov 13, 2021 · 3 comments
Closed

[SR-15480] Parsing integer with ParseableFormatStyle crashes #3944

swift-ci opened this issue Nov 13, 2021 · 3 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-15480
Radar None
Original Reporter jasonbobier (JIRA User)
Type Bug
Environment

Xcode: 13.1 (13A1030d)

macOS: 12.0.1 (21A559)

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 911cf49fbf22b16394d76bb3858ac67a

Issue Description:

try Int("15,000,000,000,000,000,123", format: .number)

crashes with:

error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).

You can just paste it into a playground to see.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from swiftlang/swift May 5, 2022
@pd95
Copy link

pd95 commented Jul 6, 2022

This is an issue I've reported to Apple (FB9968041). According to my understanding the "new" formatting and parsing styles (based on ParseStrategy protocol) were introduces with iOS 15 and macOS 12 and are Apple platform specific.

Looking up the Initialiser init(_ value: String, format: IntegerFormatStyle) or IntegerFormatStyle within Xcode is giving me a result in "Foundation" but doing the same in this swift-corelibs-foundation does not find any match.

I think this issue is at the wrong place here.

@jasonbobier
Copy link

Note that I also logged this with Apple (FB11962946).

@parkera
Copy link
Contributor

parkera commented Jul 5, 2024

This was addressed in swiftlang/swift-foundation#658. See also #5001

@parkera parkera closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants