Simon, this sequence should work:

bnp=nv_search("_Bool",shp->bltin_tree,0);
b_t=nv_type(bnp); // get type node
np = nv_open(shp->var_tree,...);
nv_settype(np, b_t, 0);

Olga

On Wed, Jul 17, 2013 at 6:44 AM, Simon Toedt <[email protected]> wrote:
> On Fri, Mar 22, 2013 at 10:58 PM, David Korn <[email protected]> wrote:
>> cc:  [email protected]
>> Subject: Re: Re: Re: [ast-developers] Create _Bool variable from C code?
>> --------
>>
>>> How can I figure out if the type is of type _Bool when I have the
>>> pointer returned by nv_type(np)?
>>>
>>>
>>         nv_type(np)->nvname
>
> I tried the suggestion and was granted a SEGV ;(
>
> Does this look correct to you?
>
> bt=nv_search("_Bool",shp->bltin_tree,0);
> np = nv_open(shp->var_tree,...);
> nv_settype(np, bt, 0);
>
> The code gives me this SEGV:
> (gdb) where
> #0  0x0000000000803200 in sh ()
> #1  0x0000000000495e91 in clone_all_disc (np=0x7ffff7ee2700,
> mp=0x7ffff7f29ca0, flags=512) at src/cmd/ksh93/sh/nvdisc.c:893
> #2  0x00000000004960d0 in nv_clone (np=0x7ffff7ee2700,
> mp=0x7ffff7f29ca0, flags=512) at src/cmd/ksh93/sh/nvdisc.c:944
> #3  0x000000000049cd16 in nv_settype (np=0x7ffff7f29ca0,
> tp=0x7ffff7ee2700, flags=0) at src/cmd/ksh93/sh/nvtype.c:1437
>
> Simon
> _______________________________________________
> ast-developers mailing list
> [email protected]
> http://lists.research.att.com/mailman/listinfo/ast-developers



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     [email protected]   \-`\-'----.
 `'-..-| /       http://twitter.com/fleyta     \ |-..-'`
      /\/\     Solaris/BSD//C/C++ programmer   /\/\
      `--`                                      `--`
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to