Browse Source

compiler: fix make([]T, ...) type

pull/6/head
Ayke van Laethem 6 years ago
parent
commit
fd9fa038a9
No known key found for this signature in database GPG Key ID: E97FF5335DFDFDED
  1. 1
      compiler.go

1
compiler.go

@ -2118,6 +2118,7 @@ func (c *Compiler) parseExpr(frame *Frame, expr ssa.Value) (llvm.Value, error) {
}
sliceSize := c.builder.CreateBinOp(llvm.Mul, elemSizeValue, sliceCapCast, "makeslice.cap")
slicePtr := c.builder.CreateCall(c.allocFunc, []llvm.Value{sliceSize}, "makeslice.buf")
slicePtr = c.builder.CreateBitCast(slicePtr, llvm.PointerType(llvmElemType, 0), "makeslice.array")
// Create the slice.
slice := llvm.ConstStruct([]llvm.Value{

Loading…
Cancel
Save