From 96bbd4d7e0f674e215361fdf52388a9c59b9d386 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 5 Jul 2014 01:13:45 -0700 Subject: [PATCH] Fix potential bugs in restoring newdecl state. --- sourcepawn/compiler/sc1.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index a098ead9..4dfaf515 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -3606,9 +3606,11 @@ symbol *parse_inline_function(methodmap_t *map, const typeinfo_t *type, const ch if (is_native) { target = funcstub(tMETHODMAP, &decl, thistag); } else { - sc_require_newdecls++; + int lcl_require_newdecls = sc_require_newdecls; + + sc_require_newdecls = TRUE; int ok = newfunc(&decl, thistag, FALSE, FALSE, TRUE, &target); - sc_require_newdecls--; + sc_require_newdecls = lcl_require_newdecls; if (!ok) return NULL;