mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
compiler: allow copying a string to a slice
Now that strings and slices are similar, this just works.
This commit is contained in:
@@ -1532,9 +1532,6 @@ func (c *Compiler) parseBuiltin(frame *Frame, args []ssa.Value, callName string)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return llvm.Value{}, err
|
return llvm.Value{}, err
|
||||||
}
|
}
|
||||||
if _, ok := args[1].Type().(*types.Basic); ok {
|
|
||||||
return llvm.Value{}, errors.New("todo: copy: string to []byte")
|
|
||||||
}
|
|
||||||
dstLen := c.builder.CreateExtractValue(dst, 1, "copy.dstLen")
|
dstLen := c.builder.CreateExtractValue(dst, 1, "copy.dstLen")
|
||||||
srcLen := c.builder.CreateExtractValue(src, 1, "copy.srcLen")
|
srcLen := c.builder.CreateExtractValue(src, 1, "copy.srcLen")
|
||||||
dstBuf := c.builder.CreateExtractValue(dst, 0, "copy.dstArray")
|
dstBuf := c.builder.CreateExtractValue(dst, 0, "copy.dstArray")
|
||||||
|
|||||||
Reference in New Issue
Block a user