File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
validation-test/SILOptimizer Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class DataWrapper {
29
29
var pointer : UnsafeMutableRawBufferPointer
30
30
31
31
init ( count: Int ) {
32
- pointer = UnsafeMutableRawBufferPointer . allocate ( byteCount: count, alignment: MemoryLayout< Int> . alignment)
32
+ pointer = UnsafeMutableRawBufferPointer . allocate ( byteCount: count * MemoryLayout < Int > . stride , alignment: MemoryLayout< Int> . alignment)
33
33
}
34
34
35
35
var bytes : UnsafeMutableRawBufferPointer { return pointer }
@@ -43,7 +43,7 @@ var fileHandleMap: [Int32 : String] = [:]
43
43
44
44
func openTheFile( _ path: String ) -> Int32 {
45
45
let fd : Int32 = 42
46
- assert ( fileHandleMap [ fd] == nil )
46
+ precondition ( fileHandleMap [ fd] == nil )
47
47
fileHandleMap [ fd] = path
48
48
return fd
49
49
}
@@ -53,7 +53,7 @@ func closeTheFile(_ fd: Int32) {
53
53
}
54
54
55
55
func writeToTheFile( _ fd: Int32 ) {
56
- assert ( fileHandleMap [ fd] != nil )
56
+ precondition ( fileHandleMap [ fd] != nil )
57
57
}
58
58
59
59
class FileHandleWrapper {
You can’t perform that action at this time.
0 commit comments