nrvo shouldn't touch bycopy object[backport:1.2] (#19385)
fix nim-lang#19342
This commit is contained in:
parent
5853303be0
commit
9b9ae8a487
3 changed files with 31 additions and 1 deletions
18
tests/objects/t19342.nim
Normal file
18
tests/objects/t19342.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
targets: "c cpp"
|
||||
"""
|
||||
|
||||
{.compile: "m19342.c".}
|
||||
|
||||
# bug #19342
|
||||
type
|
||||
Node* {.bycopy.} = object
|
||||
data: array[25, cint]
|
||||
|
||||
proc myproc(name: cint): Node {.importc: "hello", cdecl.}
|
||||
|
||||
proc parse =
|
||||
let node = myproc(10)
|
||||
doAssert node.data[0] == 999
|
||||
|
||||
parse()
|
||||
Loading…
Add table
Add a link
Reference in a new issue