Skip to content

Commit

Permalink
Fix the code generation of 0-sized stores
Browse files Browse the repository at this point in the history
  • Loading branch information
kyouko-taiga committed Aug 27, 2024
1 parent 3a90149 commit 00b44c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/CodeGen/LLVM/Transpilation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,10 @@ extension SwiftyLLVM.Module {
/// Inserts the transpilation of `i` at `insertionPoint`.
func insert(store i: IR.InstructionID) {
let s = m[i] as! IR.Store
insertStore(llvm(s.object), to: llvm(s.target), at: insertionPoint)
let v = llvm(s.object)
if layout.storageSize(of: v.type) > 0 {
insertStore(llvm(s.object), to: llvm(s.target), at: insertionPoint)
}
}

/// Inserts the transpilation of `i` at `insertionPoint`.
Expand Down

0 comments on commit 00b44c1

Please sign in to comment.