mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
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.
This commit is contained in:
@@ -91,7 +91,8 @@ func hashmapKeyEqualAlg(alg hashmapAlgorithm) func(x, y unsafe.Pointer, n uintpt
|
|||||||
case hashmapAlgorithmInterface:
|
case hashmapAlgorithmInterface:
|
||||||
return hashmapInterfaceEqual
|
return hashmapInterfaceEqual
|
||||||
default:
|
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:
|
case hashmapAlgorithmInterface:
|
||||||
return hashmapInterfacePtrHash
|
return hashmapInterfacePtrHash
|
||||||
default:
|
default:
|
||||||
panic("unknown hashmap hash algorithm")
|
// compiler bug :(
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user