Fix error with assignin long numbers to Integer

This commit is contained in:
2016-12-08 14:43:50 +01:00
parent 78bd901339
commit 9362287938
4 changed files with 307 additions and 209 deletions

View File

@ -62,7 +62,8 @@ bool resizeArray(T)(shared Allocator allocator,
{
return false;
}
array = cast(T[]) buf;
// Casting from void[] is unsafe, but we know we cast to the original type
array = () @trusted { return cast(T[]) buf; }();
if (oldLength < length)
{
array[oldLength .. $].uninitializedFill(init);