Commit b30f753d authored by Eden Li's avatar Eden Li Committed by Russ Cox

cgo now renders types with unknown size as [0]byte instead of raising a

fatal error.
Fixes #126.

R=rsc
https://golang.org/cl/157101
parent 6e0767bb
......@@ -315,11 +315,14 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
t.Size = dtype.Size();
t.Align = -1;
t.C = dtype.Common().Name;
c.m[dtype] = t;
if t.Size < 0 {
fatal("dwarf.Type %s reports unknown size", dtype)
// Unsized types are [0]byte
t.Size = 0;
t.Go = c.Opaque(0);
return t;
}
c.m[dtype] = t;
switch dt := dtype.(type) {
default:
fatal("unexpected type: %s", dtype)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment