Commit dc4d494a by Ian Lance Taylor

re PR go/65349 (go tool crashes, can't compile go code on 32bit linux systems)

	PR go/65349
runtime: Don't crash if explicitly freeing small map.

From-SVN: r221292
parent 4729d772
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "runtime.h" #include "runtime.h"
#include "malloc.h"
#include "go-alloc.h" #include "go-alloc.h"
#include "go-assert.h" #include "go-assert.h"
#include "map.h" #include "map.h"
...@@ -63,7 +64,8 @@ __go_map_rehash (struct __go_map *map) ...@@ -63,7 +64,8 @@ __go_map_rehash (struct __go_map *map)
} }
} }
__go_free (old_buckets); if (old_bucket_count * sizeof (void *) >= TinySize)
__go_free (old_buckets);
map->__bucket_count = new_bucket_count; map->__bucket_count = new_bucket_count;
map->__buckets = new_buckets; map->__buckets = new_buckets;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment