Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
35f33e38
Commit
35f33e38
authored
Dec 12, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: Delete from a nil map is now a no-op.
From-SVN: r194462
parent
8318d4ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
gcc/testsuite/go.test/test/nil.go
+2
-3
libgo/runtime/go-map-delete.c
+1
-1
No files found.
gcc/testsuite/go.test/test/nil.go
View file @
35f33e38
...
...
@@ -151,9 +151,8 @@ func maptest() {
shouldPanic
(
func
()
{
m
[
2
]
=
3
})
shouldPanic
(
func
()
{
delete
(
m
,
2
)
})
// can delete (non-existent) entries
delete
(
m
,
2
)
}
// nil slice
...
...
libgo/runtime/go-map-delete.c
View file @
35f33e38
...
...
@@ -27,7 +27,7 @@ __go_map_delete (struct __go_map *map, const void *key)
void
**
pentry
;
if
(
map
==
NULL
)
r
untime_panicstring
(
"deletion of entry in nil map"
)
;
r
eturn
;
descriptor
=
map
->
__descriptor
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment