Skip to content
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

[SR-3474] Swift 3 Whole Module Optimization Issue #46062

Open
swift-ci opened this issue Dec 22, 2016 · 2 comments
Open

[SR-3474] Swift 3 Whole Module Optimization Issue #46062

swift-ci opened this issue Dec 22, 2016 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation run-time crash Bug → crash: Swift code crashed during execution

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-3474
Radar radar://29763639
Original Reporter jhzdev (JIRA User)
Type Bug

Attachment: Download

Environment

building with Xcode 8.2, running on iPhone 6 iOS 10

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, OptimizedOnly, RunTimeCrash
Assignee None
Priority Medium

md5: 527562dfe02323edd05f58e89e529e0e

Issue Description:

I think I found a swift 3 whole module optimization issue. The code below, when building with release configuration and running on an iOS 10 real device, will always causes a crash.

import UIKit
class ViewController: UIViewController {
    override func viewDidLoad() {
        // Do any additional setup after loading the view.
        super.viewDidLoad()
        
        let orderby = "time"
        let url = "http://www.sample.com/api/index.php?\(orderby)"
        
        Log("Request url: \(url)")
        
        if let url = URL(string: url) {
            let request = URLRequest(url: url)
            print(request)
        }
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
func Log(_ log: String) {
    //    NSLog("%@", log)
}

You can see the attachment for more detail info.
Or if you use github, this is the repo:
https://github.com/zaczh/Swift3ClosureDemo

@swift-ci
Copy link
Collaborator Author

Comment by Jun Z. (JIRA)

fix a typo

@gottesmm
Copy link
Member

gottesmm commented Jan 7, 2017

This is a dup of [SR-3301]. This was fixed in master in: 4282f35. Should be fixed in next release.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation run-time crash Bug → crash: Swift code crashed during execution
Projects
None yet
Development

No branches or pull requests

3 participants