mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 23:43:40 +00:00
compiler: fix const complex numbers
This led to an assertion failure with a debug build of LLVM, but apparently worked with a release build of LLVM.
This commit is contained in:
@@ -3155,8 +3155,8 @@ func (c *Compiler) parseConst(prefix string, expr *ssa.Const) (llvm.Value, error
|
|||||||
return llvm.Value{}, err
|
return llvm.Value{}, err
|
||||||
}
|
}
|
||||||
cplx := llvm.Undef(llvm.VectorType(c.ctx.DoubleType(), 2))
|
cplx := llvm.Undef(llvm.VectorType(c.ctx.DoubleType(), 2))
|
||||||
cplx = c.builder.CreateInsertValue(cplx, r, 0, "")
|
cplx = c.builder.CreateInsertElement(cplx, r, llvm.ConstInt(c.ctx.Int8Type(), 0, false), "")
|
||||||
cplx = c.builder.CreateInsertValue(cplx, i, 1, "")
|
cplx = c.builder.CreateInsertElement(cplx, i, llvm.ConstInt(c.ctx.Int8Type(), 1, false), "")
|
||||||
return cplx, nil
|
return cplx, nil
|
||||||
} else {
|
} else {
|
||||||
return llvm.Value{}, errors.New("todo: unknown constant: " + expr.String())
|
return llvm.Value{}, errors.New("todo: unknown constant: " + expr.String())
|
||||||
|
|||||||
Reference in New Issue
Block a user