Skip to content

SR-10776: Fix runtime crash of calling XMLDocument's var name: String? #2316

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

Merged
merged 2 commits into from
Aug 15, 2019

Conversation

YOCKOW
Copy link
Member

@YOCKOW YOCKOW commented Jun 4, 2019

Runtime crash occurs when XMLDocument's computed property var name: String? is called. This PR fixes the issue.

Resolves SR-10776.

Note: This PR would conflict with PR#2287 and PR#2313. That's why it is a draft at the moment. This branch will be rebased after they are merged.

EDITED
#2287 has been merged. This PR seems not to conflict with #2313 after checking again. Sorry.

@YOCKOW YOCKOW changed the title SR-10776: Fix runtime crash by calling XMLDocument's var name: String? SR-10776: Fix runtime crash of calling XMLDocument's var name: String? Jun 6, 2019
@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi
Copy link
Contributor

I'll still test it.

@YOCKOW YOCKOW marked this pull request as ready for review June 7, 2019 06:06
@YOCKOW
Copy link
Member Author

YOCKOW commented Jun 7, 2019

Sorry, I have force-pushed the branch...
Here are the first test results:

@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi
Copy link
Contributor

@swift-ci please test linux

@millenomi
Copy link
Contributor

@swift-ci please test

@YOCKOW
Copy link
Member Author

YOCKOW commented Jul 25, 2019

Failure on Linux is due to mismatched curly brackets in "TestXMLDocument.swift". It doesn't occur on "YOCKOW:sr-10776" branch. Should be rebased or need some modification?

Failure Summary
/home/buildnode/jenkins/workspace/swift-corelibs-foundation-PR-Linux/swift-corelibs-foundation/TestFoundation/TestXMLDocument.swift:653:13: error: declaration is only valid at file scope
06:14:54 fileprivate extension XMLNode {
06:14:54             ^
06:14:54 /home/buildnode/jenkins/workspace/swift-corelibs-foundation-PR-Linux/swift-corelibs-foundation/TestFoundation/TestXMLDocument.swift:676:1: error: expected '}' in class
06:14:54 
06:14:54 ^
06:14:54 /home/buildnode/jenkins/workspace/swift-corelibs-foundation-PR-Linux/swift-corelibs-foundation/TestFoundation/TestXMLDocument.swift:10:44: note: to match this opening '{'
06:14:54 class TestXMLDocument : LoopbackServerTest {
06:14:54   

@spevans
Copy link
Contributor

spevans commented Jul 25, 2019

@YOCKOW Do a rebase and squash the commits then we can rerun the test.

@YOCKOW
Copy link
Member Author

YOCKOW commented Jul 26, 2019

@spevans Thank you for the advice. Fixed the bracket problem and did a rebase.

@spevans
Copy link
Contributor

spevans commented Jul 26, 2019

@swift-ci test

@YOCKOW
Copy link
Member Author

YOCKOW commented Jul 27, 2019

Jenkins doesn’t report the status of latest tests...
https://ci.swift.org/job/swift-corelibs-foundation-PR-Linux/3475/ (success)
https://ci.swift.org/job/swift-corelibs-foundation-PR-macOS/1520/ (success)

YOCKOW added 2 commits August 8, 2019 14:23
Although Libxml2's `struct _xmlDoc` has a member named `name` that indicates name/filename/URI of the document, `var name` of `XMLDocument` on Darwin returns always nil. This commit makes the behavior the same with Darwin.
@YOCKOW
Copy link
Member Author

YOCKOW commented Aug 8, 2019

Rebased again because

@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi millenomi merged commit 482a27a into swiftlang:master Aug 15, 2019
@millenomi
Copy link
Contributor

It is merged.

@millenomi
Copy link
Contributor

@YOCKOW Thank you for your patience; I'm focusing on XML for the next short while as well.

@YOCKOW YOCKOW deleted the sr-10776 branch August 16, 2019 00:26
@YOCKOW
Copy link
Member Author

YOCKOW commented Aug 16, 2019

@millenomi
Thank you too for your decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants