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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user