bug-gawk
[Top][All Lists]
Advanced

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

Re: fatal: typeof: unknown argument type `Node_param_list'


From: arnold
Subject: Re: fatal: typeof: unknown argument type `Node_param_list'
Date: Mon, 06 Jan 2025 05:47:50 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Hello.

Thanks for the report. The fix is below.

Arnold

Denis Shirokov <cosmogen@gmail.com> wrote:

> Hello
>
> found an issue while experimenting with indirect function calls:
>
> func  _typeof( p ,f ) {
>      f = "awk::typeof"
>      return @f( p ) }
>
> BEGIN{
>
>      f = "awk::typeof"
>      print "typeof: " @f( p )
>
>      print "_typeof: " _typeof( p )
>      }
>
> outputs:
>
>       typeof: untyped'
>       gawk: ./bug.gwk:3: fatal: typeof: unknown argument type
> `Node_param_list'
>
> gawk:
>
>       GNU Awk 5.3.1, API 4.0, (GNU MPFR 4.0.2, GNU MP 6.1.2)
>
> OS:
>
>       Windows 10 Pro (x64)
>       downloaded from: https://sourceforge.net/projects/ezwinports/files/
>
> Best Regards
> Denis Shirokov

-------------------------------------
diff --git a/builtin.c b/builtin.c
index f03ba701..e3beff7c 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3113,6 +3113,10 @@ do_typeof(int nargs)
        else
                dbg = NULL;
        arg = POP();
+
+       if (arg->type == Node_param_list)
+               arg = GET_PARAM(arg->param_cnt);
+
        switch (arg->type) {
        case Node_var_array:
                /* Node_var_array is never UPREF'ed */



reply via email to

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