-7 <byte-array> crash

darcs
slava 2006-11-22 05:19:19 +00:00
parent 53b9883ef8
commit 12f61890ca
2 changed files with 4 additions and 1 deletions

View File

@ -27,3 +27,5 @@ sequences test errors math-internals ;
! Make sure we report the correct error on stack underflow
[ { kernel-error 11 f f } ]
[ [ clear drop ] catch ] unit-test
[ -7 <byte-array> ] unit-test-fails

View File

@ -46,7 +46,8 @@ F_ARRAY *allot_array(CELL type, F_FIXNUM capacity, CELL fill)
/* size is in bytes this time */
F_ARRAY *allot_byte_array(F_FIXNUM size)
{
F_FIXNUM byte_size = (size + sizeof(CELL) - 1) / sizeof(CELL);
F_FIXNUM byte_size = (F_FIXNUM)(size + sizeof(CELL) - 1)
/ (F_FIXNUM)sizeof(CELL);
return allot_array(BYTE_ARRAY_TYPE,byte_size,0);
}