Allow dynamic char arrays.

This commit is contained in:
David Anderson 2014-11-08 17:39:43 -08:00
parent cd0ac3ae37
commit 3cc5c198b4
2 changed files with 8 additions and 1 deletions

View File

@ -2171,7 +2171,7 @@ static void declloc(int tokid)
//
// For now, we only implement the string literal initializer.
if (type->is_new && needtoken('=')) {
if (type->isCharArray()) {
if (type->isCharArray() && !lexpeek(tNEW)) {
// Error if we're assigning something other than a string literal.
needtoken(tSTRING);
@ -2205,6 +2205,8 @@ static void declloc(int tokid)
TRUE, FALSE, TRUE, FALSE,
&type->idxtag[i],
&child, 0, &val);
if (i == type->numdim - 1 && type->tag == pc_tag_string)
stradjust(sPRI);
pushreg(sPRI);
switch (ident) {

View File

@ -0,0 +1,5 @@
public OnPluginStart()
{
char[] x = new char[500];
}