Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/LLVM/Module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ extension Module {
path.withCString { cString in
let mutable = strdup(cString)
LLVMPrintModuleToFile(llvm, mutable, &err)
free(mutable)
free(mutable!)
}
if let err = err {
defer { LLVMDisposeMessage(err) }
Expand Down Expand Up @@ -325,7 +325,7 @@ extension Module {
public func emitBitCode(to path: String) throws {
let status = path.withCString { cString -> Int32 in
let mutable = strdup(cString)
defer { free(mutable) }
defer { free(mutable!) }
return LLVMWriteBitcodeToFile(llvm, mutable)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/LLVM/TargetMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public class TargetMachine {
var err: UnsafeMutablePointer<Int8>?
let status = path.withCString { cStr -> LLVMBool in
let mutable = strdup(cStr)
defer { free(mutable) }
defer { free(mutable!) }
return LLVMTargetMachineEmitToFile(llvm, module.llvm, mutable, type.asLLVM(), &err)
}
if let err = err, status != 0 {
Expand Down