Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Paul Hilfinger <Hilfinger@adacore.com>
Cc: gdb@sourceware.org
Subject: Re: Strange case for expect_type
Date: Wed, 28 Nov 2007 13:07:00 -0000	[thread overview]
Message-ID: <20071128130706.GA12708@caradoc.them.org> (raw)
In-Reply-To: <20071128084549.E25BD48CC02@nile.gnat.com>

On Wed, Nov 28, 2007 at 03:45:49AM -0500, Paul Hilfinger wrote:
> 
> Can anyone explain this code fragment from evaluate_subexp_standard?
> 
>     case UNOP_IND:
>       if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
> 	expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
>       arg1 = evaluate_subexp (expect_type, exp, pos, noside);
> 
> It SEEMS to be saying that if I "expect" type T* from expression *E, then
> I should expect type T from E.  Say what?  Thanks for any help.

It's also got the logic of typedef checking wrong; you're supposed to
check_typedef before using TYPE_CODE, not after.  Doesn't make sense
to me either.  You can probably reach this code easiest by the
function call case.

                  argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1),
                                                 exp, pos, noside);


-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2007-11-28 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28  8:45 Paul Hilfinger
2007-11-28 13:07 ` Daniel Jacobowitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071128130706.GA12708@caradoc.them.org \
    --to=drow@false.org \
    --cc=Hilfinger@adacore.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox