summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2022-12-10 22:16:11 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2022-12-14 12:10:44 +0000
commitdb91d049e0db8300915cd78a2abb8dd9407e90c6 (patch)
treeae56c8616998d016a96c5457823257347e41cc32
parent1829598c6e4e29da89d73624e461aaffd983fde3 (diff)
downloadperl-db91d049e0db8300915cd78a2abb8dd9407e90c6.tar.gz
Token type `pval` should be a void * pointer
The `pval` field of the token type union is currently only used in one place; storing the result of the infix operator plugin. Its use here stores a structure pointer, not a string. The union should define this field as a `void *` and not a `char *`. In addition we should not attempt to debug print it as a string because its value is not valid as one.
-rw-r--r--perly.act2
-rw-r--r--perly.h4
-rw-r--r--perly.tab2
-rw-r--r--perly.y2
-rw-r--r--toke.c6
5 files changed, 8 insertions, 8 deletions
diff --git a/perly.act b/perly.act
index 010674827b..02ab182c3f 100644
--- a/perly.act
+++ b/perly.act
@@ -2127,6 +2127,6 @@ case 2:
/* Generated from:
- * 21f50be92bd623859b76b35d4165bcd0fbe33785929bfc0a6a522d266e86de40 perly.y
+ * d159cbbb0bfd3916708be07894588433a9434f9ade8adce98532533a9ea86747 perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */
diff --git a/perly.h b/perly.h
index 60fcf6d891..d7a2f273ad 100644
--- a/perly.h
+++ b/perly.h
@@ -209,7 +209,7 @@ union YYSTYPE
I32 ival; /* __DEFAULT__ (marker for regen_perly.pl;
must always be 1st union member) */
- char *pval;
+ void *pval;
OP *opval;
GV *gvval;
@@ -226,6 +226,6 @@ int yyparse (void);
/* Generated from:
- * 21f50be92bd623859b76b35d4165bcd0fbe33785929bfc0a6a522d266e86de40 perly.y
+ * d159cbbb0bfd3916708be07894588433a9434f9ade8adce98532533a9ea86747 perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */
diff --git a/perly.tab b/perly.tab
index 01b90afedd..fa22eea783 100644
--- a/perly.tab
+++ b/perly.tab
@@ -1222,6 +1222,6 @@ static const toketypes yy_type_tab[] =
};
/* Generated from:
- * 21f50be92bd623859b76b35d4165bcd0fbe33785929bfc0a6a522d266e86de40 perly.y
+ * d159cbbb0bfd3916708be07894588433a9434f9ade8adce98532533a9ea86747 perly.y
* acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl
* ex: set ro: */
diff --git a/perly.y b/perly.y
index ee0504cf32..79f040baca 100644
--- a/perly.y
+++ b/perly.y
@@ -38,7 +38,7 @@
%union {
I32 ival; /* __DEFAULT__ (marker for regen_perly.pl;
must always be 1st union member) */
- char *pval;
+ void *pval;
OP *opval;
GV *gvval;
}
diff --git a/toke.c b/toke.c
index 87fc2462a9..274bdcdd04 100644
--- a/toke.c
+++ b/toke.c
@@ -573,7 +573,7 @@ S_tokereport(pTHX_ I32 rv, const YYSTYPE* lvalp)
PL_op_name[lvalp->ival]);
break;
case TOKENTYPE_PVAL:
- Perl_sv_catpvf(aTHX_ report, "(pval=\"%s\")", lvalp->pval);
+ Perl_sv_catpvf(aTHX_ report, "(pval=%p)", lvalp->pval);
break;
case TOKENTYPE_OPVAL:
if (lvalp->opval) {
@@ -8831,7 +8831,7 @@ yyl_keylookup(pTHX_ char *s, GV *gv)
(*def->parse)(aTHX_ &result->parsedata, def);
s = PL_bufptr; /* restore local s variable */
}
- pl_yylval.pval = (char *)result;
+ pl_yylval.pval = result;
CLINE;
OPERATOR(tokentype_for_plugop(def));
}
@@ -8937,7 +8937,7 @@ yyl_try(pTHX_ char *s)
(*def->parse)(aTHX_ &result->parsedata, def);
s = PL_bufptr; /* restore local s variable */
}
- pl_yylval.pval = (char *)result;
+ pl_yylval.pval = result;
CLINE;
OPERATOR(tokentype_for_plugop(def));
}