src/runtime: handle nil map write panics

This commit is contained in:
Damian Gryski
2022-03-09 15:41:53 -08:00
committed by Ron Evans
parent e45ff9c0e8
commit 5c488e3145
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -32,6 +32,11 @@ func nilPanic() {
runtimePanic("nil pointer dereference")
}
// Panic when trying to add an entry to a nil map
func nilMapPanic() {
runtimePanic("assignment to entry in nil map")
}
// Panic when trying to acces an array or slice out of bounds.
func lookupPanic() {
runtimePanic("index out of range")