From 9a26ae05265eb6906bd34eade98ba459b0d31617 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Mon, 30 Mar 2015 14:06:13 +0200 Subject: [PATCH] Fix declaring variable on same line after array int a[5], b; b would get a size of |0| on the stack instead of a sizeof(cell_t). Bug: https://bugs.alliedmods.net/show_bug.cgi?id=6335 --- sourcepawn/compiler/sc1.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sourcepawn/compiler/sc1.cpp b/sourcepawn/compiler/sc1.cpp index 6fa858d4..a3a8ff7f 100644 --- a/sourcepawn/compiler/sc1.cpp +++ b/sourcepawn/compiler/sc1.cpp @@ -3478,10 +3478,9 @@ static int reparse_new_decl(declinfo_t *decl, int flags) // // Reset the fact that we saw an array. decl->type.numdim = 0; - decl->type.size = 0; decl->type.enumroot = NULL; decl->type.ident = iVARIABLE; - decl->type.size = 0; + decl->type.size = 1; decl->type.has_postdims = false; if (matchtoken('[')) parse_old_array_dims(decl, flags);