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 */