bug-gawk
[Top][All Lists]
Advanced

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

Re: fatal error: internal error with Gawk 5.2.1


From: arnold
Subject: Re: fatal error: internal error with Gawk 5.2.1
Date: Wed, 25 Jan 2023 12:24:08 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Volodymyr Gubarkov <xonixx@gmail.com> wrote:

> Sure, thank you for your work!
>
> I'm not quite sure the error of Vincent is the same as mine (most likely).
> But I've managed to derive even smaller example based on Vincent's code:
>
> $ ./soft/gawk521 '
>  function tailmatch(string) {
>    length(string)
>  }
>
>  BEGIN {
>      tailmatch(defanchors["test"])
>      defanchors["test"] = defanchors["test"]
>  }'
> free(): double free detected in tcache 2
> Aborted (core dumped)
>
> Hope, this helps.

Indeed it did. The patch below seems to do the trick.

Arnold
------------------------------------------------
diff --git a/interpret.h b/interpret.h
index 4540d302..0034f58a 100644
--- a/interpret.h
+++ b/interpret.h
@@ -344,7 +344,9 @@ uninitialized_scalar:
                                }
                        }
 
-                       if (r->type == Node_val || r->type == Node_elem_new)
+                       if (r->type == Node_val
+                           || r->type == Node_var
+                           || r->type == Node_elem_new)
                                UPREF(r);
                        PUSH(r);
                        break;



reply via email to

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