From d3d7d28f48f0f4ec3f5cf5d018255ea731f01f56 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 23 Jun 2011 21:48:07 -0700 Subject: [PATCH] op_lvalue .= _flags 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 | 3 ++- embed.h | 1 - global.sym | 2 +- op.c | 2 +- op.h | 2 ++ proto.h | 3 ++- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/embed.fnc b/embed.fnc index 71c10af..d9a888a 100644 --- 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 --- a/embed.h +++ b/embed.h @@ -375,7 +375,6 @@ #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) diff --git a/global.sym b/global.sym index 89fb825..30614c4 100644 --- a/global.sym +++ b/global.sym @@ -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 --- 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 --- a/op.h +++ b/op.h @@ -763,6 +763,8 @@ preprocessing token; the type of I depends on I. #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 --- 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 \ -- 2.7.4