POV-Ray : Newsgroups : povray.general : return dictionary from macro [bug?] : Re: return dictionary from macro [bug?] Server Time
23 Sep 2021 19:17:50 EDT (-0400)
  Re: return dictionary from macro [bug?]  
From: William F Pokorny
Date: 14 Apr 2021 08:59:31
Message: <6076e733$1@news.povray.org>
On 4/13/21 1:17 PM, ingo wrote:
> Not sure wether this was reported before.
> //-----------
> #version 3.8;
> #macro SomeThing(A)
>    #local RD = dictionary;
>    RD
> #end
> #declare SD = SomeThing(1);
> //-----------

I'm confused as to what you are trying to do. Not myself used 
dictionaries much as yet, but it looks to me like you are after:

#macro SomeThing()
#declare SD = SomeThing();

That said. Playing around with your original, first encoding I do see 
flaky segfaults which come and go in the povr branch that includes a set 
of v3.8 parser fixes necessary for other parser issues.

Thus far, the direct encoding above has never crashed. Neither has v3.8 
master at commit 74b3ebe0 for ANY variation of your encodings (ignoring 
the second (RD) one and less any heavy dictionary use).

I'll try and get together a debug build over the next few days - 
hopefully it crashes reliably enough I can run down the cause. I suspect 
something is going wrong with the identifier pointer handling when we 
get to the:

#declare SD = RD; // Effective action

Then depending on where the pointers point in memory and perhaps too the 
actual dictionary use, we crash or not - but, we shall see.

Bill P.

Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.