Thread overview | |||||
---|---|---|---|---|---|
|
April 02, 2012 Help with C++ | ||||
---|---|---|---|---|
| ||||
Hi, I'm trying to make some additions to DMD. First I want to add a virtual function: virtual void emitLink(OutBuffer *buf) to the struct Type. I did that. Then on doc.c I implement it empty: void Type::emitLink(OutBuffer *buf) { } Then I use it somewhere, like in AliasDeclaration::toDocBuffer: type->emitLink(buf); I compile it, it's fine. When I run DMD with the -D switch I get: Bus error: 10 I thought maybe the type is null, so: if (type) type->emitLink(buf); But no luck. I tried to copy the prototype of: virtual TypeBasic *isTypeBasic() without luck. What am I doing wrong? Thanks, Ary |
April 02, 2012 Re: Help with C++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Manzana | On 02.04.2012 18:27, Ary Manzana wrote: > Hi, > > I'm trying to make some additions to DMD. > > First I want to add a virtual function: > > virtual void emitLink(OutBuffer *buf) > > to the struct Type. > > I did that. Then on doc.c I implement it empty: > > void Type::emitLink(OutBuffer *buf) { } > > Then I use it somewhere, like in AliasDeclaration::toDocBuffer: > > type->emitLink(buf); > > I compile it, it's fine. When I run DMD with the -D switch I get: > > Bus error: 10 Looks like a link-time breakage, i.e. some object file compiled against an older version of header/src and consequently older v-table. Maybe the dmd makefile is faulty and doesn't trigger proper rebuilds, do a 'make clean' to be sure. -- Dmitry Olshansky |
April 03, 2012 Re: Help with C++ | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | On 4/3/12 4:01 AM, Dmitry Olshansky wrote:
> On 02.04.2012 18:27, Ary Manzana wrote:
>> Hi,
>>
>> I'm trying to make some additions to DMD.
>>
>> First I want to add a virtual function:
>>
>> virtual void emitLink(OutBuffer *buf)
>>
>> to the struct Type.
>>
>> I did that. Then on doc.c I implement it empty:
>>
>> void Type::emitLink(OutBuffer *buf) { }
>>
>> Then I use it somewhere, like in AliasDeclaration::toDocBuffer:
>>
>> type->emitLink(buf);
>>
>> I compile it, it's fine. When I run DMD with the -D switch I get:
>>
>> Bus error: 10
>
> Looks like a link-time breakage, i.e. some object file compiled against
> an older version of header/src and consequently older v-table.
> Maybe the dmd makefile is faulty and doesn't trigger proper rebuilds, do
> a 'make clean' to be sure.
>
>
>
>
Yes, that was it. Thanks!
|
Copyright © 1999-2021 by the D Language Foundation