bug-gawk
[Top][All Lists]
Advanced

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

Re: for-in FUNCTAB


From: arnold
Subject: Re: for-in FUNCTAB
Date: Thu, 29 Oct 2020 08:54:04 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Thanks for the report. The fix is below. I will get it into
the repo soon.

Arnold

Denis Shirokov <cosmogen@gmail.com> wrote:

> hello
>
> found the following issue:
>
> BEGIN{
>       PROCINFO[ "sorted_in" ] = "sort"
>       for ( i in FUNCTAB )
>             print i "'" }
>
> func  sort( i1, v1, i2, v2 ) {
>       return 1 }
>
> gawk: ./er.gwk:5: fatal: internal error line 1338, file: eval.c
>
> the issue isn't occure if PROCINFO[ "sorted_in" ] isn't set to call
> user-defined function.
> issue occure only with FUNCTAB array.
>
> GNU Awk 5.1.0, API: 3.0 (GNU MPFR 3.1.5, GNU MP 6.1.2)
> Copyright (C) 1989, 1991-2020 Free Software Foundation.
>
> Windows 10x64
>
> Kind Regards
> Denis

diff --git a/eval.c b/eval.c
index 9b3342c8..558c021e 100644
--- a/eval.c
+++ b/eval.c
@@ -1337,6 +1337,13 @@ setup_frame(INSTRUCTION *pc)
                        r->var_value = m;
                        break;
 
+               case Node_func:
+               case Node_builtin_func:
+               case Node_ext_func:
+                       r->type = Node_var;
+                       r->var_value = make_string(m->vname, strlen(m->vname));
+                       break;
+
                default:
                        cant_happen();
                }



reply via email to

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