Skip to content

Commit 043d1c6

Browse files
committed
Update test lexical-lifetimes.swift
1 parent 565e92e commit 043d1c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

validation-test/SILOptimizer/lexical-lifetimes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DataWrapper {
2929
var pointer: UnsafeMutableRawBufferPointer
3030

3131
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)
3333
}
3434

3535
var bytes: UnsafeMutableRawBufferPointer { return pointer }
@@ -43,7 +43,7 @@ var fileHandleMap: [Int32 : String] = [:]
4343

4444
func openTheFile(_ path: String) -> Int32 {
4545
let fd: Int32 = 42
46-
assert(fileHandleMap[fd] == nil)
46+
precondition(fileHandleMap[fd] == nil)
4747
fileHandleMap[fd] = path
4848
return fd
4949
}
@@ -53,7 +53,7 @@ func closeTheFile(_ fd: Int32) {
5353
}
5454

5555
func writeToTheFile(_ fd: Int32) {
56-
assert(fileHandleMap[fd] != nil)
56+
precondition(fileHandleMap[fd] != nil)
5757
}
5858

5959
class FileHandleWrapper {

0 commit comments

Comments
 (0)