compiler: refactor asserts

This commit is contained in:
Ayke van Laethem
2019-11-23 00:15:06 +01:00
committed by Ron Evans
parent 7733666fa8
commit b8d20535ba
4 changed files with 67 additions and 67 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ func (c *Compiler) emitMakeChan(frame *Frame, expr *ssa.MakeChan) llvm.Value {
elementSize := c.targetData.TypeAllocSize(c.getLLVMType(expr.Type().(*types.Chan).Elem()))
elementSizeValue := llvm.ConstInt(c.uintptrType, elementSize, false)
bufSize := frame.getValue(expr.Size)
c.emitChanBoundsCheck(frame, elementSize, bufSize, expr.Size.Type().Underlying().(*types.Basic), expr.Pos())
frame.createChanBoundsCheck(elementSize, bufSize, expr.Size.Type().Underlying().(*types.Basic), expr.Pos())
if bufSize.Type().IntTypeWidth() < c.uintptrType.IntTypeWidth() {
bufSize = c.builder.CreateZExt(bufSize, c.uintptrType, "")
} else if bufSize.Type().IntTypeWidth() > c.uintptrType.IntTypeWidth() {