From e956429166632c68785a17be44b649ae6205bfb0 Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Wed, 10 Dec 2008 13:28:46 -0800 Subject: [PATCH] string hash function faults w empty string fixes maps[""] R=r OCL=20909 CL=20911 --- src/runtime/runtime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 3d0ee7f1e6..c075181a02 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -583,6 +583,8 @@ static uint64 stringhash(uint32 s, string *a) { USED(s); + if(*a == nil) + return memhash(emptystring->len, emptystring->str); return memhash((*a)->len, (*a)->str); } -- 2.48.1