bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] bug related to hash function


From: Andres Legarra
Subject: Re: [bug-gawk] bug related to hash function
Date: Tue, 10 May 2016 09:28:35 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0



On 09/05/16 19:56, Aharon Robbins wrote:
[ Resent with correct bug address. ]

Hi.

I have fixed the problem. Patch below.
Thanks !

I have no clue why this only manifests in 4.1.0 forward.

May I add your test program and a few lines from the data file to
the test suite?
Sure !
What was the problem finally? From the comment I understand that the index became an integer causing (I guess) some kind of wrong table in a hash table or something?

Andres

Thanks,

Arnold
---------------------------------
diff --git a/str_array.c b/str_array.c
index 2ffa5df..c122ab9 100644
--- a/str_array.c
+++ b/str_array.c
@@ -187,6 +187,15 @@ str_lookup(NODE *symbol, NODE *subs)
 		subs = dupnode(subs);
 	}
 
+	/*
+	 * Repeat after me: "Array indices are always strings."
+	 * "Array indices are always strings."
+	 * "Array indices are always strings."
+	 * "Array indices are always strings."
+	 * ....
+	 */
+	subs->flags &= ~MAYBE_NUM;
+
 	getbucket(b);
 	b->ahnext = symbol->buckets[hash1];
 	symbol->buckets[hash1] = b;

-- 
Andres Legarra
+33 561285182
INRA, UMR1388 GenPhySE 
CS 52627
31326 Castanet Tolosan, France 

reply via email to

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