Bug with "assign" and external routines?

3 messages Options
Embed this post
Permalink
Martin Piskernig

Bug with "assign" and external routines?

Reply Threaded More More options
Print post
Permalink
Hi!

I am experiencing a strange problem with the "assign" keyword.

For normal Eiffel attributes/routines, it works like a charm.

But now I have the following situation:
* An external routine "i" (which interfaces with Java (JNI) and gets the value
of the static field "i" of some class):
i:INTEGER_32 assign set_i external ... end
* The setter looks like the following:
set_i(an_i:INTEGER_32) external ... end

Now I try to assign a value to that i somewhere else in Eiffel code:
{TEST}.i := 3
This doesn't work. "i" still contains its old value.

I first guessed the error is in my usage of JNI. However, by calling
{TEST}.set_i(3) directly instead of using the assigner, it works!

Is this maybe a bug in the EiffelStudio compiler or is such (exotic) usage of
the assigner limited in some way by Standard Eiffel?
I am using: ISE EiffelStudio version 6.5.7.9743 GPL Edition - linux-x86-64

Using the latest EiffelStudio release available from Sourceforge (ISE
EiffelStudio version 6.5.8.945 GPL Edition - linux-x86-64) the assignment
{TEST}.i := 3 crashes immediately in the runtime with a segfault. The set_i
command from above works correctly like in the older version.

Thanks!
Martin
Alexander Kogtenkov [ES]-2

Re: Bug with "assign" and external routines?

Reply Threaded More More options
Print post
Permalink
Dear Martin,

It must be a bug in the implementation of assigner commands for
external features. It would be great if you submit a bug report
at the support site.

Thank you,
Alexander Kogtenkov


----- Original Message -----
From: "Martin Piskernig" <[hidden email]>
To: <[hidden email]>
Sent: Friday, October 02, 2009 3:59 PM
Subject: [eiffel_software] Bug with "assign" and external routines?


> Hi!
>
> I am experiencing a strange problem with the "assign" keyword.
>
> For normal Eiffel attributes/routines, it works like a charm.
>
> But now I have the following situation:
> * An external routine "i" (which interfaces with Java (JNI) and gets the value
> of the static field "i" of some class):
> i:INTEGER_32 assign set_i external ... end
> * The setter looks like the following:
> set_i(an_i:INTEGER_32) external ... end
>
> Now I try to assign a value to that i somewhere else in Eiffel code:
> {TEST}.i := 3
> This doesn't work. "i" still contains its old value.
>
> I first guessed the error is in my usage of JNI. However, by calling
> {TEST}.set_i(3) directly instead of using the assigner, it works!
>
> Is this maybe a bug in the EiffelStudio compiler or is such (exotic) usage of
> the assigner limited in some way by Standard Eiffel?
> I am using: ISE EiffelStudio version 6.5.7.9743 GPL Edition - linux-x86-64
>
> Using the latest EiffelStudio release available from Sourceforge (ISE
> EiffelStudio version 6.5.8.945 GPL Edition - linux-x86-64) the assignment
> {TEST}.i := 3 crashes immediately in the runtime with a segfault. The set_i
> command from above works correctly like in the older version.
>
> Thanks!
> Martin
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
Martin Piskernig

Re: Bug with "assign" and external routines?

Reply Threaded More More options
Print post
Permalink
On Freitag, 2. Oktober 2009, Alexander Kogtenkov [ES] wrote:
> It must be a bug in the implementation of assigner commands for
> external features. It would be great if you submit a bug report
> at the support site.

I have just submitted the bug report, thank you!

On closer inspection, the bug only happens when trying to assign a value
through a static call: {TEST}.i := 4 (crashes) but not when assigning
through an object of that class: test.i := 4 works where test is an
instance of TEST. I have included that information in the bug report,
too.

Kind regards,
Martin


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/