Commit Graph

12 Commits

Author SHA1 Message Date
Ben Langmuir
8e352b8006 [sourcekitd] Fix range shifting "race" with a fast semantic update
If a semantic update finishes fast enough, the token snapshot may be
identical to the edit snapshot, but because of getBufferForSnapshot
consolidating edits into a new buffer, we were not detecting that case
properly, and it could cause an assertion failure (or potentially
incorrect range shifting in a release build). This would have reproduced
very rarely in practice, but I can reproduce it by putting `sleep(2)`
calls right before we read the semantic info in open and edit requests.

Incidentally, fix sourcekit-test and unit tests for the (rare) case
where an open or edit already has updated semantic info.
2020-07-22 17:50:08 -07:00
Fred Riss
259d78a350 Adapt to llvm.org StringRef API change 2020-03-13 19:08:22 +01:00
Rintaro Ishizaki
399fece7f5 [SourceKit] Dedicated error message for 'offset' + 'length' out of range 2018-08-02 09:29:28 +09:00
Rintaro Ishizaki
930d4342cd [SourceKit] Defensive guard for invalid offset and length in edit request
Otherwise, hits assertion, or crashes in no-assertion build.

Added 'EditableTextBuffer::getSize()' for getting size after previous updates
without actually applying them.

rdar://problem/34206143
2018-08-01 20:02:15 +09:00
Bob Wilson
e614f1b4d4 master-next: attempt to fix Linux bots
After my PR 13591 to adjust for LLVM r321257, the Linux bots are failing with
errors about missing conversions. For some reason that I don't understand,
those errors do not reproduce when I build locally on macOS. I think this
change should fix them. I also cleaned up some const_casts that should now
be unnecessary when using WritableMemoryBuffer.
2017-12-21 20:14:17 -08:00
Bob Wilson
a214a4df9d master-next: use WritableMemoryBuffer::getNewUninitMemBuffer
llvm r321257 removed MemoryBuffer::getNewUninitMemBuffer. Change to use
WritableMemoryBuffer::getNewUninitMemBuffer instead.
2017-12-21 17:21:05 -08:00
Ben Langmuir
c58cc4ee39 [sourcekitd] Fix a race in EditableTextBuffer::getSnapshot()
Found by TSan!

This was found while trying to reproduce a test failure on a linux bot
while running the test/Misc/stats.swift test.  Hopefully this was the
underlying issue.

rdar://35537968
2017-11-16 14:39:31 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Argyrios Kyrtzidis
d19e4ae026 [SourceKit] Add license notices to all the source files. 2015-11-05 12:01:14 -08:00
Argyrios Kyrtzidis
8ff6a98a99 [sourcekit] Merge SourceKit into the Swift repo.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.

SourceKit is disabled on non-darwin platforms.
2015-11-05 01:09:08 -08:00