diff --git a/sourcepawn/compiler/sc.h b/sourcepawn/compiler/sc.h index 92f613a5..c6e0e8de 100644 --- a/sourcepawn/compiler/sc.h +++ b/sourcepawn/compiler/sc.h @@ -590,7 +590,7 @@ SC_FUNC void moveto1(void); SC_FUNC void pushreg(regid reg); SC_FUNC void pushval(cell val); SC_FUNC void popreg(regid reg); -SC_FUNC void genarray(int dims); +SC_FUNC void genarray(int dims, int _autozero); SC_FUNC void swap1(void); SC_FUNC void ffswitch(int label); SC_FUNC void ffcase(cell value,char *labelname,int newtable); diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 6d4082c0..50b7c320 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -1961,7 +1961,7 @@ static int declloc(int fstatic) needtoken(')'); numdim++; } while (matchtoken('(')); - genarray(numdim); + genarray(numdim, autozero); } if (getstates(name)) error(88,name); /* local variables may not have states */ diff --git a/sourcepawn/compiler/sc4.c b/sourcepawn/compiler/sc4.c index 834aeac5..a9971783 100644 --- a/sourcepawn/compiler/sc4.c +++ b/sourcepawn/compiler/sc4.c @@ -675,9 +675,13 @@ SC_FUNC void popreg(regid reg) /* * Generate an array */ -SC_FUNC void genarray(int dims) +SC_FUNC void genarray(int dims, int _autozero) { - stgwrite("\tgenarray "); + if (_autozero) { + stgwrite("\tgenarray.z "); + } else { + stgwrite("\tgenarray "); + } outval(dims, TRUE); code_idx+=opcodes(1)+opargs(1); } diff --git a/sourcepawn/compiler/sc6.c b/sourcepawn/compiler/sc6.c index 7dd4a295..97ead13e 100644 --- a/sourcepawn/compiler/sc6.c +++ b/sourcepawn/compiler/sc6.c @@ -490,6 +490,7 @@ static OPCODEC opcodelist[] = { /*{124, "file", sIN_CSEG, do_file }, */ {119, "fill", sIN_CSEG, parm1 }, {162, "genarray", sIN_CSEG, parm1 }, + {163, "genarray.z", sIN_CSEG, parm1 }, {100, "geq", sIN_CSEG, parm0 }, { 99, "grtr", sIN_CSEG, parm0 }, {120, "halt", sIN_CSEG, parm1 },