op_lvalue .= _flags
authorFather Chrysostomos <sprout@cpan.org>
Fri, 24 Jun 2011 04:48:07 +0000 (21:48 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 24 Jun 2011 15:19:26 +0000 (08:19 -0700)
Add flags param to op_lvalue, so that the caller can ask it not to
croak when encountering an unmodifiable op (upcoming).

This is in preparation for making the \$ prototype accept any lvalue.

There is no mathom, as the changes that this will support
are by no means suitable for maint.

embed.fnc
embed.h
global.sym
op.c
op.h
proto.h

index 71c10af..d9a888a 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -751,7 +751,8 @@ Apd |void   |mg_magical     |NN SV* sv
 Apd    |int    |mg_set         |NN SV* sv
 Ap     |I32    |mg_size        |NN SV* sv
 Ap     |void   |mini_mktime    |NN struct tm *ptm
-AMpd   |OP*    |op_lvalue      |NULLOK OP* o|I32 type
+AMmd   |OP*    |op_lvalue      |NULLOK OP* o|I32 type
+poX    |OP*    |op_lvalue_flags|NULLOK OP* o|I32 type|U32 flags
 : To be removed after 5.14 (see [perl #78908]):
 EXp    |OP*    |mod            |NULLOK OP* o|I32 type
 : Used in op.c and pp_sys.c
diff --git a/embed.h b/embed.h
index 77373e1..e2428c9 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define op_dump(a)             Perl_op_dump(aTHX_ a)
 #define op_free(a)             Perl_op_free(aTHX_ a)
 #define op_linklist(a)         Perl_op_linklist(aTHX_ a)
-#define op_lvalue(a,b)         Perl_op_lvalue(aTHX_ a,b)
 #define op_null(a)             Perl_op_null(aTHX_ a)
 #define op_prepend_elem(a,b,c) Perl_op_prepend_elem(aTHX_ a,b,c)
 #define op_refcnt_lock()       Perl_op_refcnt_lock(aTHX)
index 89fb825..30614c4 100644 (file)
@@ -426,7 +426,7 @@ Perl_op_contextualize
 Perl_op_dump
 Perl_op_free
 Perl_op_linklist
-Perl_op_lvalue
+Perl_op_lvalue_flags
 Perl_op_null
 Perl_op_prepend_elem
 Perl_op_refcnt_lock
diff --git a/op.c b/op.c
index e5780e3..5cb6392 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1424,7 +1424,7 @@ such as C<$$x = 5> which might have to vivify a reference in C<$x>.
 */
 
 OP *
-Perl_op_lvalue(pTHX_ OP *o, I32 type)
+Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags)
 {
     dVAR;
     OP *kid;
diff --git a/op.h b/op.h
index 0d03efd..24463a8 100644 (file)
--- a/op.h
+++ b/op.h
@@ -763,6 +763,8 @@ preprocessing token; the type of I<arg> depends on I<which>.
 #define RV2CVOPCV_MARK_EARLY     0x00000001
 #define RV2CVOPCV_RETURN_NAME_GV 0x00000002
 
+#define op_lvalue(op,t) Perl_op_lvalue_flags(aTHX_ op,t,0)
+
 /*
 =head1 Custom Operators
 
diff --git a/proto.h b/proto.h
index 9d47ba5..8fc49de 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2765,7 +2765,8 @@ PERL_CALLCONV OP* Perl_op_linklist(pTHX_ OP *o)
 #define PERL_ARGS_ASSERT_OP_LINKLIST   \
        assert(o)
 
-PERL_CALLCONV OP*      Perl_op_lvalue(pTHX_ OP* o, I32 type);
+/* PERL_CALLCONV OP*   op_lvalue(pTHX_ OP* o, I32 type); */
+PERL_CALLCONV OP*      Perl_op_lvalue_flags(pTHX_ OP* o, I32 type, U32 flags);
 PERL_CALLCONV void     Perl_op_null(pTHX_ OP* o)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_OP_NULL       \