projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6675c41
)
Fix calling make with slice whose element type is size zero.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 20 Sep 2011 22:06:20 +0000
(22:06 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 20 Sep 2011 22:06:20 +0000
(22:06 +0000)
From-SVN: r179019
libgo/runtime/go-make-slice.c
patch
|
blob
|
history
diff --git
a/libgo/runtime/go-make-slice.c
b/libgo/runtime/go-make-slice.c
index cd2d55bd538dc5d3dfa3ded2450e3c0120e013c9..d0e8369c1f6c99ead51f2fa397677ac1ac5a10f2 100644
(file)
--- a/
libgo/runtime/go-make-slice.c
+++ b/
libgo/runtime/go-make-slice.c
@@
-35,7
+35,8
@@
__go_make_slice2 (const struct __go_type_descriptor *td, uintptr_t len,
icap = (int) cap;
if (cap < len
|| (uintptr_t) icap != cap
- || cap > (uintptr_t) -1U / std->__element_type->__size)
+ || (std->__element_type->__size > 0
+ && cap > (uintptr_t) -1U / std->__element_type->__size))
__go_panic_msg ("makeslice: cap out of range");
ret.__count = ilen;