Skip to content

Commit

Permalink
Remove GV_ADDINEVAL
Browse files Browse the repository at this point in the history
This flag does absolutely nothing.  The use of 8 as a flag to pass to
gv_fetchpv was added in this commit:

commit 93233ec
Author: Chip Salzenberg <chip@pobox.com>
Date:   Tue Mar 3 04:39:49 1998 +0000

    [win32] merge problematic maintpatch to op.c
            #77:  "Eliminate double warnings under C<package;>"
          Files:  gv.c op.c toke.c

But nothing in gv.c made use of it at the time.

Later it was changed into a #define in commit 0f30349.  Subse-
quently more uses were added in 77ca0c9 and f558d5a.

It still does nothing.  Nothing outside the perl core references it.
  • Loading branch information
Father Chrysostomos committed Sep 7, 2014
1 parent b69f576 commit 4bff32c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gv.h
Expand Up @@ -221,7 +221,7 @@ Return the CV from the GV.
#define GV_ADDMULTI 0x02 /* add, pretending it has been added
already; used also by gv_init_* */
#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */
#define GV_ADDINEVAL 0x08 /* add, as though we're doing so within an eval */
/* 0x08 UNUSED */
#define GV_NOINIT 0x10 /* add, but don't init symbol, if type != PVGV */
/* This is used by toke.c to avoid turing placeholder constants in the symbol
table into full PVGVs with attached constant subroutines. */
Expand Down
13 changes: 4 additions & 9 deletions toke.c
Expand Up @@ -2054,7 +2054,7 @@ S_force_ident(pTHX_ const char *s, int kind)
warnings if the symbol must be introduced in an eval.
GSAR 96-10-12 */
gv_fetchpvn_flags(s, len,
(PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL)
(PL_in_eval ? GV_ADDMULTI
: GV_ADD) | ( UTF ? SVf_UTF8 : 0 ),
kind == '$' ? SVt_PV :
kind == '@' ? SVt_PVAV :
Expand Down Expand Up @@ -8162,10 +8162,7 @@ S_pending_ident(pTHX)
pl_yylval.opval->op_private = OPpCONST_ENTERED;
if (pit != '&')
gv_fetchsv(sym,
(PL_in_eval
? (GV_ADDMULTI | GV_ADDINEVAL)
: GV_ADDMULTI
),
GV_ADDMULTI,
((PL_tokenbuf[0] == '$') ? SVt_PV
: (PL_tokenbuf[0] == '@') ? SVt_PVAV
: SVt_PVHV));
Expand Down Expand Up @@ -8209,7 +8206,7 @@ S_pending_ident(pTHX)
pl_yylval.opval->op_private = OPpCONST_ENTERED;
if (pit != '&')
gv_fetchpvn_flags(PL_tokenbuf+1, tokenbuf_len - 1,
(PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : GV_ADD)
(PL_in_eval ? GV_ADDMULTI : GV_ADD)
| ( UTF ? SVf_UTF8 : 0 ),
((PL_tokenbuf[0] == '$') ? SVt_PV
: (PL_tokenbuf[0] == '@') ? SVt_PVAV
Expand Down Expand Up @@ -9384,9 +9381,7 @@ S_scan_inputsymbol(pTHX_ char *start)
++d;
intro_sym:
gv = gv_fetchpv(d,
(PL_in_eval
? (GV_ADDMULTI | GV_ADDINEVAL)
: GV_ADDMULTI) | ( UTF ? SVf_UTF8 : 0 ),
GV_ADDMULTI | ( UTF ? SVf_UTF8 : 0 ),
SVt_PV);
PL_lex_op = readline_overriden
? (OP*)newUNOP(OP_ENTERSUB, OPf_STACKED,
Expand Down

0 comments on commit 4bff32c

Please sign in to comment.