#ifdef DJGPP
|| (_djstat_fail_bits & _STFAIL_TRUENAME)!=0
#endif
- ) {
- if (ckWARN_d(WARN_INPLACE))
- Perl_warner(aTHX_ WARN_INPLACE,
- "Can't do inplace edit: %s would not be unique",
- SvPVX(sv) );
+ )
+ {
+ if (ckWARN_d(WARN_INPLACE))
+ Perl_warner(aTHX_ WARN_INPLACE,
+ "Can't do inplace edit: %s would not be unique",
+ SvPVX(sv));
do_close(gv,FALSE);
continue;
}
void
Perl_gp_free(pTHX_ GV *gv)
{
+ dTHR;
GP* gp;
CV* cv;
- dTHR;
if (!gv || !(gp = GvGP(gv)))
return;
- if (gp->gp_refcnt == 0 && ckWARN_d(WARN_INTERNAL)) {
- Perl_warner(aTHX_ WARN_INTERNAL, "Attempt to free unreferenced glob pointers");
+ if (gp->gp_refcnt == 0) {
+ if (ckWARN_d(WARN_INTERNAL))
+ Perl_warner(aTHX_ WARN_INTERNAL,
+ "Attempt to free unreferenced glob pointers");
return;
}
if (gp->gp_cv) {
{
dTHR;
- if (((!p != !SvPOK(cv)) || (p && strNE(p, SvPVX(cv)))) &&
- ckWARN_d(WARN_UNSAFE) ) {
+ if (((!p != !SvPOK(cv)) || (p && strNE(p, SvPVX(cv)))) && ckWARN_d(WARN_UNSAFE)) {
SV* msg = sv_newmortal();
SV* name = Nullsv;
maximum a prototype before. */
if (SvTYPE(gv) > SVt_NULL) {
if (!SvPOK((SV*)gv) && !(SvIOK((SV*)gv) && SvIVX((SV*)gv) == -1)
- && ckWARN_d(WARN_UNSAFE))
+ && ckWARN_d(WARN_UNSAFE))
+ {
Perl_warner(aTHX_ WARN_UNSAFE, "Runaway prototype");
+ }
cv_ckproto((CV*)gv, NULL, ps);
}
if (ps)
Perl_oopsHV(pTHX_ OP *o)
{
dTHR;
-
- dTHR;
switch (o->op_type) {
case OP_PADSV:
up = (char*)s;
s += UTF8SKIP(s);
down = (char*)(s - 1);
- if ((s > send || !((*down & 0xc0) == 0x80)) &&
- ckWARN_d(WARN_UTF8)) {
- Perl_warner(aTHX_ WARN_UTF8, "Malformed UTF-8 character");
+ if (s > send || !((*down & 0xc0) == 0x80)) {
+ if (ckWARN_d(WARN_UTF8))
+ Perl_warner(aTHX_ WARN_UTF8,
+ "Malformed UTF-8 character");
break;
}
while (down > up) {
S_dumpuntil(pTHX_ regnode *start, regnode *node, regnode *last, SV* sv, I32 l)
{
#ifdef DEBUGGING
- register char op = EXACT; /* Arbitrary non-END op. */
+ register U8 op = EXACT; /* Arbitrary non-END op. */
register regnode *next, *onode;
while (op != END && (!last || node < last)) {
break;
case ASCII:
while (s < strend) {
- if (isASCII(*s)) {
+ if (isASCII(*(U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
break;
case NASCII:
while (s < strend) {
- if (!isASCII(*s)) {
+ if (!isASCII(*(U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
{
#ifdef DEBUGGING
dTHR;
- if (!PL_op && ckWARN_d(WARN_DEBUGGING)) {
- Perl_warner(aTHX_ WARN_DEBUGGING, "NULL OP IN RUN");
+ if (!PL_op) {
+ if (ckWARN_d(WARN_DEBUGGING))
+ Perl_warner(aTHX_ WARN_DEBUGGING, "NULL OP IN RUN");
return 0;
}
#ifdef DEBUGGING
if (SvTEMP(sv)) {
if (ckWARN_d(WARN_DEBUGGING))
- Perl_warner(aTHX_ WARN_DEBUGGING,
- "Attempt to free temp prematurely: SV 0x%lx", (unsigned long)sv);
+ Perl_warner(aTHX_ WARN_DEBUGGING,
+ "Attempt to free temp prematurely: SV 0x%lx", (unsigned long)sv);
return;
}
#endif
Useless use of a constant in void context at - line 4.
########
# op.c
+$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak
use warning 'unsafe' ;
my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
@a =~ /abc/ ;
%$c =~ tr/a/b/ ;
}
EXPECT
-Applying pattern match to @array will act on scalar(@array) at - line 4.
-Applying substitution to @array will act on scalar(@array) at - line 5.
-Can't modify private array in substitution at - line 5, near "s/a/b/ ;"
-Applying character translation to @array will act on scalar(@array) at - line 6.
-Applying pattern match to @array will act on scalar(@array) at - line 7.
-Applying substitution to @array will act on scalar(@array) at - line 8.
-Applying character translation to @array will act on scalar(@array) at - line 9.
-Applying pattern match to %hash will act on scalar(%hash) at - line 10.
-Applying substitution to %hash will act on scalar(%hash) at - line 11.
-Applying character translation to %hash will act on scalar(%hash) at - line 12.
-Applying pattern match to %hash will act on scalar(%hash) at - line 13.
-Applying substitution to %hash will act on scalar(%hash) at - line 14.
-Applying character translation to %hash will act on scalar(%hash) at - line 15.
-BEGIN not safe after errors--compilation aborted at - line 17.
+Applying pattern match to @array will act on scalar(@array) at - line 5.
+Applying substitution to @array will act on scalar(@array) at - line 6.
+Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
+Applying character translation to @array will act on scalar(@array) at - line 7.
+Applying pattern match to @array will act on scalar(@array) at - line 8.
+Applying substitution to @array will act on scalar(@array) at - line 9.
+Applying character translation to @array will act on scalar(@array) at - line 10.
+Applying pattern match to %hash will act on scalar(%hash) at - line 11.
+Applying substitution to %hash will act on scalar(%hash) at - line 12.
+Applying character translation to %hash will act on scalar(%hash) at - line 13.
+Applying pattern match to %hash will act on scalar(%hash) at - line 14.
+Applying substitution to %hash will act on scalar(%hash) at - line 15.
+Applying character translation to %hash will act on scalar(%hash) at - line 16.
+BEGIN not safe after errors--compilation aborted at - line 18.
########
# op.c
use warning 'syntax' ;
S_check_uni(pTHX)
{
char *s;
- char ch;
char *t;
dTHR;
if ((t = strchr(s, '(')) && t < PL_bufptr)
return;
if (ckWARN_d(WARN_AMBIGUOUS)){
- ch = *s;
+ char ch = *s;
*s = '\0';
Perl_warner(aTHX_ WARN_AMBIGUOUS,
"Warning: Use of \"%s\" without parens is ambiguous",
}
safe_bareword:
- if (lastchar && strchr("*%&", lastchar) &&
- ckWARN_d(WARN_AMBIGUOUS)) {
+ if (lastchar && strchr("*%&", lastchar) && ckWARN_d(WARN_AMBIGUOUS)) {
Perl_warner(aTHX_ WARN_AMBIGUOUS,
"Operator or semicolon missing before %c%s",
lastchar, PL_tokenbuf);
we in octal/hex/binary?" indicator to disallow hex characters
when in octal mode.
*/
+ dTHR;
UV u;
I32 shift;
bool overflowed = FALSE;
- dTHR;
/* check for hex */
if (s[1] == 'x') {
digit:
n = u << shift; /* make room for the digit */
if (!overflowed && (n >> shift) != u
- && !(PL_hints & HINT_NEW_BINARY) && ckWARN_d(WARN_UNSAFE)) {
- Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in %s number",
- (shift == 4) ? "hex"
- : ((shift == 3) ? "octal" : "binary"));
+ && !(PL_hints & HINT_NEW_BINARY))
+ {
+ if (ckWARN_d(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "Integer overflow in %s number",
+ (shift == 4) ? "hex"
+ : ((shift == 3) ? "octal" : "binary"));
overflowed = TRUE;
}
u = n | b; /* add the digit to the end */
}
bool
-is_uni_punct(U32 c)
+Perl_is_uni_punct(pTHX_ U32 c)
{
U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
register UV retval = 0;
bool overflowed = FALSE;
while (len && *s >= '0' && *s <= '1') {
- dTHR;
- register UV n = retval << 1;
- if (!overflowed && (n >> 1) != retval && ckWARN_d(WARN_UNSAFE)) {
- Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in binary number");
- overflowed = TRUE;
- }
- retval = n | (*s++ - '0');
- len--;
+ register UV n = retval << 1;
+ if (!overflowed && (n >> 1) != retval) {
+ dTHR;
+ if (ckWARN_d(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in binary number");
+ overflowed = TRUE;
+ }
+ retval = n | (*s++ - '0');
+ len--;
}
if (len && (*s >= '2' && *s <= '9')) {
dTHR;
bool overflowed = FALSE;
while (len && *s >= '0' && *s <= '7') {
- dTHR;
register UV n = retval << 3;
- if (!overflowed && (n >> 3) != retval && ckWARN_d(WARN_UNSAFE)) {
- Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in octal number");
+ if (!overflowed && (n >> 3) != retval) {
+ dTHR;
+ if (ckWARN_d(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in octal number");
overflowed = TRUE;
}
retval = n | (*s++ - '0');
}
}
n = retval << 4;
- {
+ if (!overflowed && (n >> 4) != retval) {
dTHR;
- if (!overflowed && (n >> 4) != retval && ckWARN_d(WARN_UNSAFE)) {
- Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in hex number");
- overflowed = TRUE;
- }
+ if (ckWARN_d(WARN_UNSAFE))
+ Perl_warner(aTHX_ WARN_UNSAFE, "Integer overflow in hex number");
+ overflowed = TRUE;
}
retval = n | ((tmp - PL_hexdigit) & 15);
}