summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y17
1 files changed, 16 insertions, 1 deletions
diff --git a/perly.y b/perly.y
index c8163e135e..93e5f77af9 100644
--- a/perly.y
+++ b/perly.y
@@ -39,7 +39,22 @@ struct ysv {
YYSTYPE oldyylval;
};
-static void yydestruct(pTHXo_ void *ptr);
+static void yydestruct(void *ptr);
+
+static void
+yydestruct(void *ptr)
+{
+ struct ysv* ysave = (struct ysv*)ptr;
+ if (ysave->yyss) Safefree(ysave->yyss);
+ if (ysave->yyvs) Safefree(ysave->yyvs);
+ yydebug = ysave->oldyydebug;
+ yynerrs = ysave->oldyynerrs;
+ yyerrflag = ysave->oldyyerrflag;
+ yychar = ysave->oldyychar;
+ yyval = ysave->oldyyval;
+ yylval = ysave->oldyylval;
+ Safefree(ysave);
+}
%}