string hash function faults w empty string

fixes maps[""]

R=r
OCL=20909
CL=20911
This commit is contained in:
Ken Thompson 2008-12-10 13:28:46 -08:00
parent 7dd62cb3bc
commit e956429166

View File

@ -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);
}