Compiler: Fix enum field size was not taken into account when implicitly passed to a function.

Imported from Pawn 3.3.3930.

Example:

---

enum tag
{
  member[32]
}

new var[tag];

foo(const string[], size = sizeof(string))
{
    // size returns 1 before fix, 32, after.
}

public plugin_init()
{
    foo(var[member]);
}

---
This commit is contained in:
Arkshine
2014-08-17 13:56:51 +02:00
parent f60b00ee71
commit a873066466
2 changed files with 2 additions and 2 deletions

View File

@ -2047,7 +2047,7 @@ static int nesting=0;
error(47); /* array sizes must match */
} /* if */
} /* if */
if (lval.ident!=iARRAYCELL) {
if (lval.ident!=iARRAYCELL|| lval.constval>0) {
/* save array size, for default values with uSIZEOF flag */
cell array_sz=lval.constval;
assert(array_sz!=0);/* literal array must have a size */