This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: Path for void constants
- To: "Daniel Bonniot" <bonniot at cma dot ensmp dot fr>
- Subject: Re: Path for void constants
- From: Per Bothner <per at bothner dot com>
- Date: 25 Jan 2000 10:40:28 -0800
- Cc: "Kawa" <kawa at sourceware dot cygnus dot com>
- References: <003d01bf675f$0670c0f0$0ccca8c0@cma.ensmp.fr>
"Daniel Bonniot" <bonniot@cma.ensmp.fr> writes:
> First, there is a bug in QuoteExp : if value is null (like for
> QuoteExp.nullExp), getType fails. It should return pointer_type. Here's the
> patch:
I'll check this in.
> Second, method Compilation.compileConstant (Object value, Target target)
> emits a warning when 'value' is Values.empty and 'target' is a StackTarget
> with a void type.
I suspect that is is the problem: You should not be using a StackTarget
with a void type. Instead use IgnoreTarget. For convenience,
you can use Target.pushValue(type) and target.returnValue(type)
to get the correct Targets.
(This is perhaps not as consistent and well-thought out as it
could be; I notice that StackTarget.compileFromStack0 does
convert a void result to Values.empty. Perhaps things would be
more consistent if IgnoreTarget inherited from StackTarget. Or
maybe not.)
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/