Commit Graph

7859 Commits

Author SHA1 Message Date
practicalswift
c2415448aa [SourceKit] Add test case for crash triggered in swift::DeclContext::getProtocolSelf() const
Stack trace:

```
found code completion token A at offset 159
4  swift-ide-test  0x0000000000b462ee swift::DeclContext::getProtocolSelf() const + 30
6  swift-ide-test  0x00000000009305a0 swift::configureImplicitSelf(swift::TypeChecker&, swift::AbstractFunctionDecl*, swift::GenericParamList*&) + 176
9  swift-ide-test  0x0000000000930acd swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 797
14 swift-ide-test  0x0000000000b59c4d swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1117
24 swift-ide-test  0x0000000000ae4334 swift::Decl::walk(swift::ASTWalker&) + 20
25 swift-ide-test  0x0000000000b6d88e swift::SourceFile::walk(swift::ASTWalker&) + 174
26 swift-ide-test  0x0000000000b6cc6f swift::ModuleDecl::walk(swift::ASTWalker&) + 79
27 swift-ide-test  0x0000000000b473a2 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
28 swift-ide-test  0x0000000000863b2d swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
29 swift-ide-test  0x0000000000773cd4 swift::CompilerInstance::performSema() + 3316
30 swift-ide-test  0x000000000071c633 main + 35027
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl declaration 0x4253e40 at <INPUT-FILE>:2:1
2.	While type-checking 'p' at <INPUT-FILE>:2:22
```
2015-12-14 18:07:59 +01:00
Dmitri Gribenko
212cb4a65c Merge pull request #533 from practicalswift/remaining-typos-replaces-batch-12-and-17
Fix typos (12 of 30, 16 of 30)
2015-12-14 08:43:27 -08:00
practicalswift
ca47cc6287 [SourceKit] Add test case for crash triggered in swift::TypeChecker::getTypeOfExpressionWithoutApplying(swift::Expr*&, swift::DeclContext*, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*)
Stack trace:

```
found code completion token A at offset 109
swift-ide-test: /path/to/swift/lib/Sema/TypeCheckConstraints.cpp:1247: Optional<swift::Type> swift::TypeChecker::getTypeOfExpressionWithoutApplying(swift::Expr *&, swift::DeclContext *, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener *): Assertion `exprType && !exprType->is<ErrorType>() && "erroneous solution?"' failed.
8  swift-ide-test  0x000000000091ca15 swift::TypeChecker::getTypeOfExpressionWithoutApplying(swift::Expr*&, swift::DeclContext*, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*) + 517
10 swift-ide-test  0x000000000090557e swift::getTypeOfCompletionContextExpr(swift::ASTContext&, swift::DeclContext*, swift::Expr*&) + 1150
12 swift-ide-test  0x0000000000863bd6 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 230
13 swift-ide-test  0x0000000000773cd4 swift::CompilerInstance::performSema() + 3316
14 swift-ide-test  0x000000000071c633 main + 35027
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking expression at [<INPUT-FILE>:2:3 - line:2:3] RangeText="0"
```
2015-12-14 16:40:55 +01:00
practicalswift
c6e8459187 Fix typos. 2015-12-14 11:13:30 +01:00
Chris Willmore
7f08c9d785 Merge pull request #476 from jtbandes/enum-crash
Add missing setIsParseError() during enum case parsing
2015-12-13 13:45:16 -08:00
Jacob Bandes-Storch
1b142ed054 Add missing setIsParseError() during enum case parsing
An invalid `case` construct would incorrectly return a successful status, causing `parseDecl` to crash later when it assumed there were valid decls in the `Entries` vector.
2015-12-13 13:11:22 -08:00
practicalswift
5112308aa6 [SourceKit] Add test case for crash triggered in swift::TypeBase::getCanonicalType()
Stack trace:

```
found code completion token A at offset 137
4  swift-ide-test  0x0000000000b8adc4 swift::TypeBase::getCanonicalType() + 20
6  swift-ide-test  0x0000000000936237 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
7  swift-ide-test  0x0000000000904e72 swift::typeCheckCompletionDecl(swift::Decl*) + 1122
18 swift-ide-test  0x0000000000ae4594 swift::Decl::walk(swift::ASTWalker&) + 20
19 swift-ide-test  0x0000000000b6db1e swift::SourceFile::walk(swift::ASTWalker&) + 174
20 swift-ide-test  0x0000000000b6ceff swift::ModuleDecl::walk(swift::ASTWalker&) + 79
21 swift-ide-test  0x0000000000b47602 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
22 swift-ide-test  0x0000000000863d8d swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
23 swift-ide-test  0x0000000000773d54 swift::CompilerInstance::performSema() + 3316
24 swift-ide-test  0x000000000071c7c3 main + 35027
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl declaration 0x<INPUT-FILE>:2:1
2.	While type-checking 'C' at <INPUT-FILE>:2:20
```
2015-12-13 12:54:16 +01:00
Dmitri Gribenko
3d7ed4a2ba Merge pull request #475 from practicalswift/sourcekit-002-swift-diagnosticengine-emitdiagnostic
[SourceKit] Add test case for crash triggered in swift::DiagnosticEngine::emitDiagnostic(swift:…
2015-12-13 01:49:20 -08:00
practicalswift
02c025042c Add SourceKit crash in swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&)
found code completion token A at offset 139
swift-ide-test: /path/to/llvm/include/llvm/Support/Casting.h:95: static bool llvm::isa_impl_cl<swift::ParenType, const swift::TypeBase *>::doit(const From *) [To = swift::ParenType, From = const swift::TypeBase *]: Assertion `Val && "isa<> used on a null pointer"' failed.
10 swift-ide-test  0x0000000000b4aecf swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 3039
11 swift-ide-test  0x0000000000b4a19f swift::DiagnosticEngine::flushActiveDiagnostic() + 319
15 swift-ide-test  0x0000000000936237 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
16 swift-ide-test  0x0000000000904e72 swift::typeCheckCompletionDecl(swift::Decl*) + 1122
21 swift-ide-test  0x0000000000ae4594 swift::Decl::walk(swift::ASTWalker&) + 20
22 swift-ide-test  0x0000000000b6db1e swift::SourceFile::walk(swift::ASTWalker&) + 174
23 swift-ide-test  0x0000000000b6ceff swift::ModuleDecl::walk(swift::ASTWalker&) + 79
24 swift-ide-test  0x0000000000b47602 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
25 swift-ide-test  0x0000000000863d8d swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
26 swift-ide-test  0x0000000000773d54 swift::CompilerInstance::performSema() + 3316
27 swift-ide-test  0x000000000071c7c3 main + 35027
Stack dump:
0.		Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.		While walking into decl getter for a at <INPUT-FILE>:2:6
2.		While type-checking 'a' at <INPUT-FILE>:2:27
2015-12-13 09:54:38 +01:00
Arsen Gasparyan
52890e5c30 Replace if true {} with do {} 2015-12-13 10:54:54 +03:00
Arsen Gasparyan
3961b71e4e Use real arc4random_uniform() instead of just random() % max 2015-12-13 10:17:35 +03:00
Chris Lattner
d12b5d0666 Merge pull request #421 from practicalswift/less-exotic-swift-frontend-arguments
Compiler crashers: Use canonical "-emit-silgen" to trigger crash case.
2015-12-12 15:11:25 -08:00
practicalswift
4585bce530 Add SourceKit crash.
Thanks to @ddunbar who suggested swift-ide-test as a fuzzing target:
https://twitter.com/daniel_dunbar/status/675712444228997120
2015-12-12 22:53:35 +01:00
Max Moiseev
a1c05e6c95 fixing post-merge failures 2015-12-11 15:55:02 -08:00
Max Moiseev
786e1ea2b1 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-11 15:19:02 -08:00
Doug Gregor
06c5e9cd5b Enable "omit needless words" by default.
Most of this is in updating the standard library, SDK overlays, and
piles of test cases to use the new names. No surprises here, although
this shows us some potential heuristic tweaks.

There is one substantive compiler change that needs to be factored out
involving synthesizing calls to copyWithZone()/copy(zone:). Aside from
that, there are four failing tests:

    Swift :: ClangModules/objc_parse.swift
    Swift :: Interpreter/SDK/Foundation_test.swift
    Swift :: Interpreter/SDK/archiving_generic_swift_class.swift
    Swift :: Interpreter/SDK/objc_currying.swift

due to two independent remaining compiler bugs:
  * We're not getting partial ordering between NSCoder's
  encode(AnyObject, forKey: String) and NSKeyedArchiver's version of
  that method, and
  * Dynamic lookup (into AnyObject) doesn't know how to find the new
  names. We need the Swift name lookup tables enabled to address this.
2015-12-11 14:46:50 -08:00
Dmitri Gribenko
06d6dab133 Merge pull request #438 from practicalswift/sync-with-swift-compiler-crashes-20151211
Sync with https://github.com/practicalswift/swift-compiler-crashes
2015-12-11 14:42:05 -08:00
Doug Gregor
851f2eaf60 Merge pull request #272 from jtbandes/fix3
[AST] Improve ErrorType handling in TypeBase::getMemberSubstitutions()
2015-12-11 13:55:59 -08:00
Doug Gregor
53b1503a78 Merge pull request #253 from jtbandes/master
Fix crash in `DependentGenericTypeResolver::resolveDependentMemberType`
2015-12-11 13:53:01 -08:00
practicalswift
b55d606412 Update with last commit of synced repo. 2015-12-11 21:47:34 +01:00
practicalswift
fe2bc2421e Sync with https://github.com/practicalswift/swift-compiler-crashes
Add 5 compiler crashes (+ 1 fixed crash).
2015-12-11 21:35:06 +01:00
Slava Pestov
f6e4355b69 Sema: Fix monthly TypeNullifier bug
This time, the issue is that TypeNullifier skips bodies of
multi-statement closures. However, ExprRewriter will type
happily pass them on to typeCheckClosureBody(). This could
trigger assertions. Fix this by skipping type checking of
multi-statement closures when diagnosing.

There seems to be a minor QoI regression in some test cases
that already looked pretty dodgy and/or had FIXMEs. However
I think its worth fixing a crash.
2015-12-11 08:58:52 -08:00
practicalswift
0ae877ac2c Use canonical "-emit-silgen" to trigger crash case. 2015-12-11 10:51:46 +01:00
Maxim Moiseev
b702b1a903 more number type renames 2015-12-10 17:08:41 -08:00
Maxim Moiseev
1b6244f3ee integer types renamed 2015-12-10 17:03:40 -08:00
Max Moiseev
7c4a693c3c fixing OptionSetType related tests 2015-12-10 16:59:18 -08:00
Maxim Moiseev
0e0191380a OptionSetType => OptionSet 2015-12-10 14:58:24 -08:00
Maxim Moiseev
2c95bb6d51 BooleanType => Boolean 2015-12-10 14:56:32 -08:00
Jacob Bandes-Storch
61dea21228 Fix crash in DependentGenericTypeResolver::resolveDependentMemberType
An erroneous `baseTy` would cause resolveArchetype to return nullptr, resulting in a null dereference.
2015-12-10 14:52:53 -08:00
Dmitri Gribenko
78930e7fac Remove MutableSliceable 2015-12-10 14:50:12 -08:00
Dmitri Gribenko
21f081fc1a Merge pull request #405 from practicalswift/normalize-run-directives
Compiler crashers: Normalize format of "RUN:" directives.
2015-12-10 14:36:19 -08:00
Dmitri Gribenko
5995ef2acd Mark one crasher test as fixed on OS X 2015-12-10 14:30:17 -08:00
practicalswift
eae3eea17f Compiler crashers: Normalize format of "RUN:" directives.
Will allow for easy parsing of common "RUN:" directives.
2015-12-10 22:58:00 +01:00
Jacob Bandes-Storch
71b15e9a06 [AST] Improve ErrorType handling in TypeBase::getMemberSubstitutions()
Historical note: a similar change was made in 0033bda.
2015-12-10 13:11:06 -08:00
Dmitri Gribenko
3e5ce67605 Merge pull request #398 from practicalswift/rename-to-match-naming-in-swift-compiler-crashes
Rename old crash cases to match the current naming scheme.
2015-12-10 13:02:21 -08:00
Dmitri Gribenko
38af324034 Merge pull request #396 from practicalswift/sync-with-swift-compiler-crashes-20151210b
Sync with https://github.com/practicalswift/swift-compiler-crashes
2015-12-10 12:39:43 -08:00
Max Moiseev
d610fa0d1c Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-10 10:29:52 -08:00
practicalswift
6029492e9f Remove since identical with 01739-swift-constraints-constraintsystem-solvesimplified.swift. 2015-12-10 17:03:34 +01:00
practicalswift
d132d07b53 Remove since identical with 00924-swift-parser-consumetoken.swift. 2015-12-10 17:02:33 +01:00
practicalswift
dc5a6a740f Remove since identical with 00805-swift-constraints-constraintsystem-opengeneric.swift. 2015-12-10 17:01:30 +01:00
practicalswift
7efd093c6f Remove since identical with 0035-cerror.swift. 2015-12-10 17:00:04 +01:00
practicalswift
c4866885c8 Rename old crash cases to match the current naming scheme.
Will allow for easy import of crash cases from swift-compiler-crashes.
2015-12-10 16:50:15 +01:00
practicalswift
159d58dd8c Sync with https://github.com/practicalswift/swift-compiler-crashes
Add 5 compiler crashes.
2015-12-10 15:44:25 +01:00
Dmitri Gribenko
f3ecc3cdc5 transcode(..., stopOnError:) => transcode(..., stoppingOnError:) 2015-12-09 17:18:55 -08:00
Dmitri Gribenko
9ca2775aa1 String.appendContentsOf() => .append()
We don't want to imply that String argument is a collection of anything.
2015-12-09 17:18:33 -08:00
Dmitri Gribenko
b7f3d54f4d removeAll(keepCapacity:) => removeAll(keepingCapacity:) 2015-12-09 17:18:08 -08:00
Dmitri Gribenko
f846ef6fd1 RangeReplaceableCollection.removeRange() => .removeSubrange() 2015-12-09 17:17:51 -08:00
Dmitri Gribenko
727f011314 RangeReplaceableCollection.insert(_:atIndex:) => .insert(_:at:) 2015-12-09 17:17:41 -08:00
Dmitri Gribenko
9a9ff305f1 RangeReplaceableCollection.replaceRange() => .replaceSubrange() 2015-12-09 17:17:34 -08:00
Maxim Moiseev
844b81c46b SequenceType => Sequence 2015-12-09 17:16:56 -08:00