mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Revert "fixes #9940; genericAssign does not take care of the importC variables in refc [backport] (#23761)"
This reverts commit fda43d1f0a.
This commit is contained in:
@@ -1246,7 +1246,7 @@ proc genObjectInfo(m: BModule, typ, origType: PType, name: Rope; info: TLineInfo
|
||||
else:
|
||||
genTypeInfoAuxBase(m, typ, origType, name, rope("0"), info)
|
||||
var tmp = getNimNode(m)
|
||||
if (not isImportedType(typ)) or tfCompleteStruct in typ.flags:
|
||||
if not isImportedType(typ):
|
||||
genObjectFields(m, typ, origType, typ.n, tmp, info)
|
||||
m.s[cfsTypeInit3].addf("$1.node = &$2;$n", [tiNameForHcr(m, name), tmp])
|
||||
var t = typ[0]
|
||||
|
||||
@@ -4,7 +4,6 @@ success
|
||||
M1 M2
|
||||
ok
|
||||
'''
|
||||
matrix: "--mm:refc;--mm:orc"
|
||||
"""
|
||||
|
||||
type
|
||||
@@ -133,30 +132,3 @@ proc foo = # bug #23280
|
||||
doAssert L mod 6 == 0
|
||||
|
||||
foo()
|
||||
|
||||
block: # bug #9940
|
||||
{.emit:"""/*TYPESECTION*/
|
||||
typedef struct { int base; } S;
|
||||
""".}
|
||||
|
||||
type S {.importc: "S", completeStruct.} = object
|
||||
base: cint
|
||||
proc init(x:ptr S) =
|
||||
x.base = 1
|
||||
|
||||
type
|
||||
Foo = object
|
||||
a: seq[float]
|
||||
b: seq[float]
|
||||
c: seq[float]
|
||||
d: seq[float]
|
||||
s: S
|
||||
|
||||
proc newT(): Foo =
|
||||
var t: Foo
|
||||
t.s.addr.init
|
||||
doAssert t.s.base == 1
|
||||
t
|
||||
|
||||
var t = newT()
|
||||
doAssert t.s.base == 1
|
||||
|
||||
Reference in New Issue
Block a user