bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] sym_constant not working properly


From: Aharon Robbins
Subject: Re: [bug-gawk] sym_constant not working properly
Date: Tue, 18 Dec 2012 20:26:00 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Hi Andy.

> > Can you please test something for me: if you use sym_constant instead
> > of sym_update, does it work properly?  I find that my program is
> > still able to modify the variable even though it was configured
> > to be a constant.  The code that sets var_assign to set_constant doesn't 
> > seem
> > to be having any impact on what happens.
>
> It seems as if sym_constant works properly when called from a
> extension module init_func, but not when it's called from an extension
> function.  In both cases the call succeeds, but when set from inside
> an extension function, there is nothing preventing user awk code
> from updating the value.
>
> Arnold -- do you have any idea what's going on here?  It looks like a bug
> to me.

It's even messier. There is different byte code generated if the extension is
loaded before or after the awk code that references the variable.

Basically, John H needs to take a harder look at this for us. There
are several op codes, Op_store_var, Op_assign, Op_var_assign, which
can be generated and which seem to be inter-related. In particular
it looks like Op_var_assign is the one to check and call the set_xxx
function we are trying to invoke.

If the Op_var_assign is never generated, then gawk code can assign to
a constant.

John? Can you look into this please?

Thanks,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]