[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk 4.2: crash
From: |
arnold |
Subject: |
Re: [bug-gawk] gawk 4.2: crash |
Date: |
Tue, 16 Jan 2018 07:15:26 -0700 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi.
Denis Shirokov <address@hidden> wrote:
> script to reproduce:
>
> BEGIN{ isarray(a) }
Yes, it's a bug. Thanks for the report.
Patch below. I will push it into Git in the next few hours.
Arnold
----------------------------------------
diff --git a/builtin.c b/builtin.c
index 54d202d..6927205 100644
--- a/builtin.c
+++ b/builtin.c
@@ -507,7 +507,9 @@ do_isarray(int nargs)
tmp = POP();
if (tmp->type != Node_var_array) {
ret = 0;
- DEREF(tmp);
+ // could be Node_var_new
+ if (tmp->type == Node_val)
+ DEREF(tmp);
}
return make_number((AWKNUM) ret);
}