Skip to content

Fix int literals which can clash with line numbers #21851

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

Conversation

beccadax
Copy link
Contributor

test/SILOptimizer/pointer_conversion.swift’s arrayLiteralPromotion() subtest uses integer literals for 41, 42, 43, and 44. If swift-evolve shuffles a particular _internalInvariant() call in stdlib/public/core/BridgeStorage.swift to lines 41-44, the compiler will generate code which reuses the integer_literal instruction for the line number later in the test, causing this test to fail. This happens about once per 45 runs of swift-evolve.

This change negates the integer literals so they will never match a line number.

test/SILOptimizer/pointer_conversion.swift’s arrayLiteralPromotion() subtest uses integer literals for 41, 42, 43, and 44. If swift-evolve shuffles a particular _internalInvariant() call in stdlib/public/core/BridgeStorage.swift to lines 41-44, the compiler will generate code which reuses the integer_literal instruction for the line number later in the test, causing this test to fail. This happens about once per 45 runs of swift-evolve.

This change negates the integer literals so they will never match a line number.
@beccadax beccadax requested a review from gottesmm January 14, 2019 21:44
@beccadax
Copy link
Contributor Author

@swift-ci please smoke test

@beccadax
Copy link
Contributor Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit ff51b7b into swiftlang:master Jan 15, 2019
@gottesmm
Copy link
Contributor

LGTM

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