Commit Graph

1566 Commits

Author SHA1 Message Date
Joe Pamer
dd141c7cad Account for recursive validation when checking if an existential conforms to itself. (rdar://problem/18042380)
This can only occur when validating mutually recursive existentials in type reference expressions, so it's "safe" to avoid validating member value decls in this case. There are still potential holes in our mechanism for checking for unsupported existentials, but at least this will eliminate another common crasher. (Crash suite scenario 010.)

Swift SVN r22035
2014-09-17 20:23:41 +00:00
Joe Groff
d3702950af SILGen: Materialize class-constrained "self" parameters when passed to non-class-constrained protocol methods.
Fixes rdar://problem/17480006, rdar://problem/17557409, rdar://problem/17929884 and crash suite #019.

Swift SVN r21981
2014-09-16 21:12:40 +00:00
Joe Groff
041c179e01 SIL: Continue type lowering after address-only fields of aggregates.
Now that we rely on type lowering to catch recursive value types, this optimization is no longer valid. Fixes rdar://problem/18232757 (crash suite #015).

Swift SVN r21967
2014-09-16 04:55:44 +00:00
Joe Groff
1c4e08a9c8 Fix up a tangle of issues related to reabstraction.
- A spot fix in SILGen for reabstracting the result of a downcast, which fixes checked casts to function types.
- Associate the layout information in type metadata records with the most abstract representation of the type. This is the correct thing to do in cases where we need the metadata as a tag for an opaque value--if we store a value in an Any, or pass it as an unconstrained generic parameter, we must maximally reabstract it. This fixes the value semantics of existentials containing trivial metatypes.
- To ensure that we get runtime layout of structs and enums correct when they contain reabstractable types, introduce a "metadata for layout" concept, which doesn't need to describe the canonical metadata for the type, but only needs to describe a type with equivalent layout and value semantics. This is a correctness fix that allows us to correctly lay out generic types containing dependent tuples and functions, and although we don't really take advantage of it here, it's also a potential runtime performance win down the road, because we could potentially produce direct metadata for a primitive type that's layout-equivalent with a runtime-instantiated type. To aid in type safety here, push SILType deeper into IRGen in places where we potentially care about specific representations of types.
- Finally, fix an inconsistency between the runtime and IRGen's concept of what spare bits unmanaged references and thick metatypes have.

Together, these fixes address rdar://problem/16406907, rdar://problem/17822208, rdar://problem/18189508, and likely many other related issues, and also fixes crash suite cases 012 and 024.

Swift SVN r21963
2014-09-16 01:44:34 +00:00
Doug Gregor
f7458a8e05 Update compiler-crashers testsuite r21946
Swift SVN r21952
2014-09-15 21:00:17 +00:00
Joe Pamer
ede74dd90e When solving for call witness argument conversions, post diagnostics in the case of failures rather than raise an assertion. This addresses crash suite issue 040. (rdar://problem/18233081)
Swift SVN r21852
2014-09-10 22:28:03 +00:00
Dmitri Hrybenko
2c93cf71f0 Mark compiler_crashers/036-lisp-style.swift as passing
Swift SVN r21833
2014-09-10 08:07:47 +00:00
Joe Pamer
9bbf4ac5fe Improve diagnostic so as not to mystify users.
Swift SVN r21824
2014-09-10 01:52:07 +00:00
Joe Pamer
acce45bdc8 Lock down existential metatype to metatype coercions. Since they're currently unsupported, we'll display a semantic error rather than crash.
This addresses crash suite scenarios 011 and 013. (rdar://problem/17777218, rdar://problem/18232728)

Swift SVN r21822
2014-09-10 00:54:34 +00:00
Joe Pamer
aeef7f736f Now that we now longer crash, reinstate test.
Swift SVN r21818
2014-09-10 00:05:29 +00:00
Joe Pamer
fa692976f5 If an expression fails to type check, and there were no failures posted or constraints to mine for a reason, we can be fairly certain that the reason for the failure was a lack of contextual type data. In this case, we should post a diagnostic rather than let the failure slip through. This addresses crash suite scenarios 001, 005, 020 and 045. (rdar://problem/16712071, rdar://problem/17317691, rdar://problem/17317691)
You'll notice that emitting this diagnostic will make some already noisy closure-related errors slightly more so. This is unfortunate, but for the time-being it's better than crashing.

Swift SVN r21817
2014-09-09 23:58:59 +00:00
Jordan Rose
e5bfd3c5dd [test] Mark three known crashers as "XFAIL: asan".
We're going to crash anyway, we'll fix it when we fix the main issue, and
the main issue isn't memory-error-related. Should unblock the ASan bot.

Swift SVN r21814
2014-09-09 22:46:56 +00:00
Dmitri Hrybenko
decff06131 Remove the test that is duplicate with
test/IRGen/mixed_objc_native_protocol_constraints.swift

Swift SVN r21804
2014-09-09 06:55:24 +00:00
Mishal Awadah
e5ca8be1a0 Add README with details on swift-compiler-crashes community repo.
Swift SVN r21717
2014-09-04 18:21:03 +00:00
Mishal Awadah
798315edd5 Add recent crasher test case from swift-compiler-crashes.
Swift SVN r21716
2014-09-04 18:21:02 +00:00
Mishal Awadah
d8ce0b80cb Add basic compilation tests from swift-compiler-crashes (https://github.com/practicalswift/swift-compiler-crashes.git)
Swift SVN r21693
2014-09-04 01:06:26 +00:00