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-9758] XMLParser.parse() returns different values between macOS and Linux when abortParsing() is called. #3549

Closed
YOCKOW opened this issue Jan 25, 2019 · 2 comments
Assignees

Comments

@YOCKOW
Copy link
Collaborator

YOCKOW commented Jan 25, 2019

Previous ID SR-9758
Radar None
Original Reporter @YOCKOW
Type Bug
Status Resolved
Resolution Done
Environment

Swift 4.2.1

OS: macOS Mojave, Ubuntu 18.04

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

md5: 2182c734fd37578a36e5879a07d9eccf

Issue Description:

The following code prints "false" on macOS, on the other hand, prints "true" on Linux.

import Foundation

let xml = """
<?xml version="1.0" encoding="UTF-8"?>
<root></root>
"""

open class Delegate: NSObject, XMLParserDelegate {
  public func parse(data:Data) {
    let xmlParser = XMLParser(data:data)
    xmlParser.delegate = self
    print(xmlParser.parse())
  }
  
  public func parserDidStartDocument(_ parser: XMLParser) {
    parser.abortParsing()
  }
}

Delegate().parse(data:xml.data(using:.utf8)!)
@YOCKOW
Copy link
Collaborator Author

YOCKOW commented Jan 31, 2019

#1867

@YOCKOW
Copy link
Collaborator Author

YOCKOW commented Feb 1, 2019

PR #1867 has been merged:
79ac432

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
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

1 participant