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
|
|
@ -220,7 +220,7 @@ proc isInvalidReturnType(conf: ConfigRef; rettype: PType): bool =
|
|||
# such a poor programming language.
|
||||
# We exclude records with refs too. This enhances efficiency and
|
||||
# is necessary for proper code generation of assignments.
|
||||
if rettype == nil or getSize(conf, rettype) > conf.target.floatSize*3:
|
||||
if rettype == nil or (tfByCopy notin rettype.flags and getSize(conf, rettype) > conf.target.floatSize*3):
|
||||
result = true
|
||||
else:
|
||||
case mapType(conf, rettype, skResult)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue