mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 16:03:41 +00:00
compiler: refactor asserts
This commit is contained in:
committed by
Ron Evans
parent
7733666fa8
commit
b8d20535ba
+1
-1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user