Re: MI: fix base members in references

Vladimir Prus
2006-12-06T08:44:38Z

On Wednesday 06 December 2006 00:46, Daniel Jacobowitz wrote:
> On Wed, Dec 06, 2006 at 10:21:06AM +1300, Nick Roberts wrote:
> > The comment in varobj.c refers to "Baseclass" and I presume the original author
> > included the case
> >
> > TYPE_CODE (value_type (parent->value)) == TYPE_CODE_REF
> >
> > for a specific reason.
>
> Probably, but as Vlad's explanation is correct, either the original
> author was wrong or the behavior of value_ind has changed. Something
> in this code should change, but see below.
>
> On Tue, Dec 05, 2006 at 01:33:12PM -0800, Jim Blandy wrote:
> > (By the way --- it's handy to include a link to the post with the
> > patch, or ideally the patch itself.)
>
> Is a threading mailer really so much to ask? :-)
>
> > How should this behave if parent->value is a reference to a pointer?
> > Shouldn't it follow the ref, and then behave the same as when it's a
> > pointer? If so, then the fix would be something like this instead
> > (not that I understand this code):
>
> If this is always the same values affected by Vlad's other patch which
> calls coerce_ref when setting the value, then maybe we should just be
> asserting there is no reference here after that patch.

That would be best.

However, I also want base/references problem to be fixed on branch, and the big
reference-changing patch might be too big for branch, while base/references patch
is small and strictly makes previously broken use case working, without any other
changes.

- Volodya