src/runtime: return a nil pointer for compiler bugs in hashmap code

We'll still panic if there's a compiler bug, but at least we'll have smaller
code in all the cases where we don't.
Этот коммит содержится в:
Damian Gryski 2022-04-27 10:28:04 -07:00 коммит произвёл Ron Evans
родитель 1abe1203a3
коммит b251ce7b33

Просмотреть файл

@ -91,7 +91,8 @@ func hashmapKeyEqualAlg(alg hashmapAlgorithm) func(x, y unsafe.Pointer, n uintpt
case hashmapAlgorithmInterface:
return hashmapInterfaceEqual
default:
panic("unknown hashmap equal algorithm")
// compiler bug :(
return nil
}
}
@ -104,7 +105,8 @@ func hashmapKeyHashAlg(alg hashmapAlgorithm) func(key unsafe.Pointer, n uintptr)
case hashmapAlgorithmInterface:
return hashmapInterfacePtrHash
default:
panic("unknown hashmap hash algorithm")
// compiler bug :(
return nil
}
}