diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2022-12-10 22:16:11 +0000 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2022-12-14 12:10:44 +0000 |
commit | db91d049e0db8300915cd78a2abb8dd9407e90c6 (patch) | |
tree | ae56c8616998d016a96c5457823257347e41cc32 | |
parent | 1829598c6e4e29da89d73624e461aaffd983fde3 (diff) | |
download | perl-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.act | 2 | ||||
-rw-r--r-- | perly.h | 4 | ||||
-rw-r--r-- | perly.tab | 2 | ||||
-rw-r--r-- | perly.y | 2 | ||||
-rw-r--r-- | toke.c | 6 |
5 files changed, 8 insertions, 8 deletions
@@ -2127,6 +2127,6 @@ case 2: /* Generated from: - * 21f50be92bd623859b76b35d4165bcd0fbe33785929bfc0a6a522d266e86de40 perly.y + * d159cbbb0bfd3916708be07894588433a9434f9ade8adce98532533a9ea86747 perly.y * acf1cbfd2545faeaaa58b1cf0cf9d7f98b5be0752eb7a54528ef904a9e2e1ca7 regen_perly.pl * ex: set ro: */ @@ -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: */ @@ -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: */ @@ -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; } @@ -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)); } |