[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible Bug (core dump) in awk 3.0.6
From: |
Aharon Robbins |
Subject: |
Re: Possible Bug (core dump) in awk 3.0.6 |
Date: |
Wed, 22 Nov 2000 12:57:06 +0200 |
> From: Dan Bornstein <address@hidden>
> Date: Wed, 15 Nov 2000 15:48:00 -0800 (PST)
> To: address@hidden
> Subject: Possible Bug (core dump) in awk 3.0.6
>
> Hi. I just found this bug when running awk 3.0.6. I have verified that the
> problem does not occur with awk 3.0.4, but these were on two different
> systems with different other libraries as well. In particular, I tested awk
> 3.0.4 on a RedHat 6.2 installation and awk 3.0.6 on a RedHat 7 installation
> (both Intel x86). The core dump makes it look to me like it could be a
> problem with libc, but I don't really know how to trace it much further
> than I've already done.
>
> [....]
>
> #!/bin/sh
>
> awk 'END { for (i in goodies) delete baddies[goodies[i]]; print baddies[i] }'
> milk
Much thanks for the bug report. Here is an unofficial patch.
Arnold
*** ../gawk-3.0.6/awk.y Sun Jul 16 18:29:50 2000
--- awk.y Tue Nov 21 16:20:22 2000
***************
*** 398,405 ****
* Check that the body is a `delete a[i]' statement,
* and that both the loop var and array names match.
*/
! if ($8->type == Node_K_delete
&& $8->rnode != NULL
&& strcmp($3, $8->rnode->var_value->vname) == 0
&& strcmp($5, $8->lnode->vname) == 0) {
$8->type = Node_K_delete_loop;
--- 398,406 ----
* Check that the body is a `delete a[i]' statement,
* and that both the loop var and array names match.
*/
! if ($8 != NULL && $8->type == Node_K_delete
&& $8->rnode != NULL
+ && $8->rnode->type == Node_var
&& strcmp($3, $8->rnode->var_value->vname) == 0
&& strcmp($5, $8->lnode->vname) == 0) {
$8->type = Node_K_delete_loop;
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd. address@hidden
P.O. Box 354 Home Phone: +972 8 979-0381 Fax: +1 603 761-6761
Nof Ayalon Cell Phone: +972 51 297-545 (See www.efax.com)
D.N. Shimshon 99785 Laundry increases exponentially in the
ISRAEL number of children. -- Miriam Robbins