From: Nicholas Clark Date: Sat, 29 Oct 2005 14:25:55 +0000 (+0000) Subject: sv_taint() can easily be replaced by a macro. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aae9cea0a2be05abb857e6b2b32773d3d5fae6d8;p=p5sagit%2Fp5-mst-13.2.git sv_taint() can easily be replaced by a macro. p4raw-id: //depot/perl@25876 --- diff --git a/embed.fnc b/embed.fnc index 6ad77da..9adba98 100644 --- a/embed.fnc +++ b/embed.fnc @@ -811,7 +811,7 @@ Apd |SV* |sv_setref_pvn |NN SV* rv|NULLOK const char* classname|NN const char* p Apd |void |sv_setpv |NN SV* sv|NULLOK const char* ptr Apd |void |sv_setpvn |NN SV* sv|NULLOK const char* ptr|STRLEN len Amdb |void |sv_setsv |NN SV* dsv|NULLOK SV* ssv -Apd |void |sv_taint |NN SV* sv +Amdb |void |sv_taint |NN SV* sv ApdR |bool |sv_tainted |NN SV* sv Apd |int |sv_unmagic |NN SV* sv|int type Apd |void |sv_unref |NN SV* sv diff --git a/embed.h b/embed.h index 5062f37..c383dc8 100644 --- a/embed.h +++ b/embed.h @@ -853,7 +853,6 @@ #define sv_setref_pvn Perl_sv_setref_pvn #define sv_setpv Perl_sv_setpv #define sv_setpvn Perl_sv_setpvn -#define sv_taint Perl_sv_taint #define sv_tainted Perl_sv_tainted #define sv_unmagic Perl_sv_unmagic #define sv_unref Perl_sv_unref @@ -2847,7 +2846,6 @@ #define sv_setref_pvn(a,b,c,d) Perl_sv_setref_pvn(aTHX_ a,b,c,d) #define sv_setpv(a,b) Perl_sv_setpv(aTHX_ a,b) #define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c) -#define sv_taint(a) Perl_sv_taint(aTHX_ a) #define sv_tainted(a) Perl_sv_tainted(aTHX_ a) #define sv_unmagic(a,b) Perl_sv_unmagic(aTHX_ a,b) #define sv_unref(a) Perl_sv_unref(aTHX_ a) diff --git a/mathoms.c b/mathoms.c index d58beb8..f165ba4 100644 --- a/mathoms.c +++ b/mathoms.c @@ -36,6 +36,19 @@ Perl_ref(pTHX_ OP *o, I32 type) return doref(o, type, TRUE); } +/* +=for apidoc sv_taint + +Taint an SV. Use C instead. +=cut +*/ + +void +Perl_sv_taint(pTHX_ SV *sv) +{ + sv_magic((sv), Nullsv, PERL_MAGIC_taint, Nullch, 0); +} + /* sv_2iv() is now a macro using Perl_sv_2iv_flags(); * this function provided for binary compatibility only */ diff --git a/proto.h b/proto.h index 3bdecd8..fd92ce3 100644 --- a/proto.h +++ b/proto.h @@ -2248,8 +2248,8 @@ PERL_CALLCONV void Perl_sv_setpvn(pTHX_ SV* sv, const char* ptr, STRLEN len) /* PERL_CALLCONV void sv_setsv(pTHX_ SV* dsv, SV* ssv) __attribute__nonnull__(pTHX_1); */ -PERL_CALLCONV void Perl_sv_taint(pTHX_ SV* sv) - __attribute__nonnull__(pTHX_1); +/* PERL_CALLCONV void sv_taint(pTHX_ SV* sv) + __attribute__nonnull__(pTHX_1); */ PERL_CALLCONV bool Perl_sv_tainted(pTHX_ SV* sv) __attribute__warn_unused_result__ diff --git a/sv.c b/sv.c index b5b8f95..a15149c 100644 --- a/sv.c +++ b/sv.c @@ -8336,19 +8336,6 @@ Perl_sv_unref(pTHX_ SV *sv) } /* -=for apidoc sv_taint - -Taint an SV. Use C instead. -=cut -*/ - -void -Perl_sv_taint(pTHX_ SV *sv) -{ - sv_magic((sv), Nullsv, PERL_MAGIC_taint, Nullch, 0); -} - -/* =for apidoc sv_untaint Untaint an SV. Use C instead. diff --git a/sv.h b/sv.h index 1e6c86a..0fff609 100644 --- a/sv.h +++ b/sv.h @@ -1034,6 +1034,8 @@ Taints an SV if tainting is enabled. =cut */ +#define sv_taint(sv) sv_magic((sv), Nullsv, PERL_MAGIC_taint, Nullch, 0) + #define SvTAINTED(sv) (SvMAGICAL(sv) && sv_tainted(sv)) #define SvTAINTED_on(sv) STMT_START{ if(PL_tainting){sv_taint(sv);} }STMT_END #define SvTAINTED_off(sv) STMT_START{ if(PL_tainting){sv_untaint(sv);} }STMT_END