POV-Ray : Newsgroups : povray.off-topic : You lose some... : Re: Some code Server Time
7 Sep 2024 03:23:58 EDT (-0400)
  Re: Some code  
From: Orchid XP v8
Date: 5 Oct 2008 08:50:32
Message: <48e8b818$1@news.povray.org>
Warp wrote:
> Orchid XP v8 <voi### [at] devnull> wrote:
>>    Tree t = build_tree(symbols);
> 
>   In this case the error messages given by valgrind wouldn't have been
> the clearest possible, but they nevertheless point to this line being
> the ultimate culprit (which, ultimately, is caused by build_tree() returning
> a reference to a local variable).

Yeah. I guess since the error only came to light when I added a new 
function, I assumed that the new function must be the problem. In fact 
it was just exhibiting a problem that already existed...

>   Anyways, I'm wondering why you are passing the parameter by value rather
> than by const reference...

Ooo, well spotted. That's simply an oversight on my part. Since all the 
syntax is still kinda new to me, I keep forgetting to write bits. (E.g., 
the compiler keeps complaining that I'm using signed integers to index 
things.)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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