mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
committed by
Andreas Rumpf
parent
432a4d1787
commit
1ec5c6fdf5
@@ -122,7 +122,7 @@ proc computeObjectOffsetsFoldFunction(conf: ConfigRef; n: PNode, initialOffset:
|
||||
let size = n.sym.typ.size
|
||||
let align = n.sym.typ.align
|
||||
result.align = align
|
||||
if initialOffset == szUnknownSize:
|
||||
if initialOffset == szUnknownSize or size == szUnknownSize:
|
||||
n.sym.offset = szUnknownSize
|
||||
result.offset = szUnknownSize
|
||||
else:
|
||||
|
||||
@@ -350,5 +350,19 @@ testinstance:
|
||||
|
||||
main()
|
||||
|
||||
{.emit: """/*TYPESECTION*/
|
||||
typedef struct{
|
||||
float a; float b;
|
||||
} Foo;
|
||||
""".}
|
||||
|
||||
type
|
||||
Foo {.importc.} = object
|
||||
|
||||
Bar = object
|
||||
b: byte
|
||||
foo: Foo
|
||||
|
||||
assert sizeof(Bar) == 12
|
||||
|
||||
echo "OK"
|
||||
|
||||
Reference in New Issue
Block a user