diff --git a/sourcepawn/compiler/sc.h b/sourcepawn/compiler/sc.h index 2b3783ac..c479e5bf 100644 --- a/sourcepawn/compiler/sc.h +++ b/sourcepawn/compiler/sc.h @@ -823,6 +823,7 @@ SC_VDECL int pc_optimize; /* (peephole) optimization level */ SC_VDECL int pc_memflags; /* special flags for the stack/heap usage */ SC_VDECL int pc_functag; /* global function tag */ SC_VDECL int pc_tag_string; /* global string tag */ +SC_VDECL int pc_anytag; /* global any tag */ SC_VDECL int glbstringread; /* last global string read */ SC_VDECL constvalue sc_automaton_tab; /* automaton table */ diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 5c22032a..10ad99b7 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -70,6 +70,7 @@ #define VERSION_STR "3.2.3636" #define VERSION_INT 0x0302 +int pc_anytag = 0; int pc_functag = 0; int pc_tag_string = 0; @@ -1256,6 +1257,8 @@ static void setconstants(void) assert(sc_status==statIDLE); append_constval(&tagname_tab,"_",0,0);/* "untagged" */ append_constval(&tagname_tab,"bool",1,0); + + pc_anytag = pc_addtag("any"); pc_functag = pc_addfunctag("Function"); pc_tag_string = pc_addtag("String"); diff --git a/sourcepawn/compiler/sc3.c b/sourcepawn/compiler/sc3.c index de5620ad..ce8182d3 100644 --- a/sourcepawn/compiler/sc3.c +++ b/sourcepawn/compiler/sc3.c @@ -327,6 +327,11 @@ SC_FUNC int matchtag(int formaltag,int actualtag,int allowcoerce) * tag is "coerced" to zero */ if (!allowcoerce || formaltag!=0 || (actualtag & FIXEDTAG)!=0) { + if (formaltag == pc_anytag) + { + return TRUE; + } + if (formaltag & FUNCTAG) { if (actualtag == pc_functag || (formaltag == pc_functag && actualtag & FUNCTAG))