1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-24 22:33:52 +03:00

Guard against out of bounds

This commit is contained in:
Tae Won Ha 2019-03-11 13:41:05 +01:00
parent 038b593881
commit 43a52e1d29
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
3 changed files with 8 additions and 2 deletions

View File

@ -149,8 +149,8 @@ final class Typesetter {
return runs.flatMap { $0 }
}
private let logger = OSLog(subsystem: Defs.loggerSubsystem,
category: Defs.LoggerCategory.view)
private let log = OSLog(subsystem: Defs.loggerSubsystem,
category: Defs.LoggerCategory.view)
private func ctRuns(
from utf16Chars: Array<Unicode.UTF16.CodeUnit>,

View File

@ -116,6 +116,7 @@
4B64239A1D8EFE3000FC78C8 /* WorkspaceTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6423991D8EFE3000FC78C8 /* WorkspaceTool.swift */; };
4B6A70941D60E04200E12030 /* AppKitCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A70931D60E04200E12030 /* AppKitCommons.swift */; };
4B6A70961D6100E300E12030 /* SwiftCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A70951D6100E300E12030 /* SwiftCommons.swift */; };
4B6DFB3A22366D140066BB43 /* OSLogCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BE867BD8F0ED0246CC94 /* OSLogCommons.swift */; };
4B9433DC20B95EC6005807BA /* MacVim-bsh.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4B9433A120B95EC1005807BA /* MacVim-bsh.icns */; };
4B9433DD20B95EC6005807BA /* MacVim-generic.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4B9433A220B95EC1005807BA /* MacVim-generic.icns */; };
4B9433DE20B95EC6005807BA /* MacVim-dylan.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4B9433A320B95EC1005807BA /* MacVim-dylan.icns */; };
@ -1211,6 +1212,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4B6DFB3A22366D140066BB43 /* OSLogCommons.swift in Sources */,
4B96FB3B1EBBC56F00E4E164 /* FileItemIgnorePattern.swift in Sources */,
4B96FB3C1EBBC56F00E4E164 /* FileUtils.swift in Sources */,
4B96FB3D1EBBC56F00E4E164 /* Matcher.swift in Sources */,

View File

@ -74,6 +74,10 @@ class Matcher {
if pchars[pidx] == tchar {
result += 1
pidx = pchars.index(after: pidx)
if pidx == pchars.endIndex {
break
}
}
}