Skip to content

Commit

Permalink
Use correct size for sizeTy[Tvector]
Browse files Browse the repository at this point in the history
This bug causes ldc-developers/ldc#825 :
When using ```Type::nullAttributes``` to create a new ```TypeVector```, it will read past the end of the source ```TypeVector``` if it was allocated using ```new TypeVector``` (i.e. the actual size is used for allocation) since ```sizeof(TypeVector)``` is less than ```sizeof(TypeBasic)```.
  • Loading branch information
Safety0ff committed Feb 23, 2015
1 parent 00cbcb3 commit 500501c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mtype.c
Expand Up @@ -218,6 +218,7 @@ void Type::init()
sizeTy[Treturn] = sizeof(TypeReturn);
sizeTy[Terror] = sizeof(TypeError);
sizeTy[Tnull] = sizeof(TypeNull);
sizeTy[Tvector] = sizeof(TypeVector);

initTypeMangle();

Expand Down

0 comments on commit 500501c

Please sign in to comment.