diff options
| author | Ken Thompson <ken@golang.org> | 2008-12-10 13:28:46 -0800 |
|---|---|---|
| committer | Ken Thompson <ken@golang.org> | 2008-12-10 13:28:46 -0800 |
| commit | e956429166632c68785a17be44b649ae6205bfb0 (patch) | |
| tree | 20c27bd3d1e2552d3ccb489e1bf3228eaeb2c1aa /src/runtime/runtime.c | |
| parent | 7dd62cb3bc51222076506132f5d409ec7fa58b38 (diff) | |
| download | go-e956429166632c68785a17be44b649ae6205bfb0.tar.xz | |
string hash function faults w empty string
fixes maps[""]
R=r
OCL=20909
CL=20911
Diffstat (limited to 'src/runtime/runtime.c')
| -rw-r--r-- | src/runtime/runtime.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); } |
