summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hitt <rbh00@utsglobal.com>2002-12-06 08:47:42 -0800
committerhv <hv@crypt.org>2002-12-17 01:43:28 +0000
commit9febdf04c602e91a389f75497c9add388bc632ec (patch)
tree5997238a86666e4319034761549523a4335f8e31
parentc7c737cb28949ebe168789b54bc0a5da1ada7664 (diff)
downloadperl-9febdf04c602e91a389f75497c9add388bc632ec.tar.gz
[Fwd: Patch for perl utf8-related bug]
[perl #18932] p4raw-id: //depot/perl@18312
-rw-r--r--embed.fnc1
-rw-r--r--embed.h2
-rw-r--r--global.sym1
-rw-r--r--perl.h1
-rw-r--r--proto.h1
-rw-r--r--regcomp.c2
-rw-r--r--scope.c13
-rw-r--r--scope.h4
8 files changed, 24 insertions, 1 deletions
diff --git a/embed.fnc b/embed.fnc
index 00c6e94a5c..c2bed8be2a 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -626,6 +626,7 @@ Ap |void |save_aelem |AV* av|I32 idx|SV **sptr
Ap |I32 |save_alloc |I32 size|I32 pad
Ap |void |save_aptr |AV** aptr
Ap |AV* |save_ary |GV* gv
+Ap |void |save_bool |bool* boolp
Ap |void |save_clearsv |SV** svp
Ap |void |save_delete |HV* hv|char* key|I32 klen
Ap |void |save_destructor|DESTRUCTORFUNC_NOCONTEXT_t f|void* p
diff --git a/embed.h b/embed.h
index 636dca9181..34181b67bd 100644
--- a/embed.h
+++ b/embed.h
@@ -564,6 +564,7 @@
#define save_alloc Perl_save_alloc
#define save_aptr Perl_save_aptr
#define save_ary Perl_save_ary
+#define save_bool Perl_save_bool
#define save_clearsv Perl_save_clearsv
#define save_delete Perl_save_delete
#define save_destructor Perl_save_destructor
@@ -2122,6 +2123,7 @@
#define save_alloc(a,b) Perl_save_alloc(aTHX_ a,b)
#define save_aptr(a) Perl_save_aptr(aTHX_ a)
#define save_ary(a) Perl_save_ary(aTHX_ a)
+#define save_bool(a) Perl_save_bool(aTHX_ a)
#define save_clearsv(a) Perl_save_clearsv(aTHX_ a)
#define save_delete(a,b,c) Perl_save_delete(aTHX_ a,b,c)
#define save_destructor(a,b) Perl_save_destructor(aTHX_ a,b)
diff --git a/global.sym b/global.sym
index 24f9e5c45d..9e3ddcd37e 100644
--- a/global.sym
+++ b/global.sym
@@ -376,6 +376,7 @@ Perl_save_aelem
Perl_save_alloc
Perl_save_aptr
Perl_save_ary
+Perl_save_bool
Perl_save_clearsv
Perl_save_delete
Perl_save_destructor
diff --git a/perl.h b/perl.h
index bb2dc3979b..614d570ae9 100644
--- a/perl.h
+++ b/perl.h
@@ -2173,6 +2173,7 @@ union any {
I32 any_i32;
IV any_iv;
long any_long;
+ bool any_bool;
void (*any_dptr) (void*);
void (*any_dxptr) (pTHX_ void*);
};
diff --git a/proto.h b/proto.h
index 78841c237d..182867d62f 100644
--- a/proto.h
+++ b/proto.h
@@ -661,6 +661,7 @@ PERL_CALLCONV void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr);
PERL_CALLCONV I32 Perl_save_alloc(pTHX_ I32 size, I32 pad);
PERL_CALLCONV void Perl_save_aptr(pTHX_ AV** aptr);
PERL_CALLCONV AV* Perl_save_ary(pTHX_ GV* gv);
+PERL_CALLCONV void Perl_save_bool(pTHX_ bool* boolp);
PERL_CALLCONV void Perl_save_clearsv(pTHX_ SV** svp);
PERL_CALLCONV void Perl_save_delete(pTHX_ HV* hv, char* key, I32 klen);
PERL_CALLCONV void Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p);
diff --git a/regcomp.c b/regcomp.c
index 4813261c01..20b68762f4 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5058,7 +5058,7 @@ Perl_save_re_context(pTHX)
SAVEVPTR(PL_reg_re); /* from regexec.c */
SAVEPPTR(PL_reg_ganch); /* from regexec.c */
SAVESPTR(PL_reg_sv); /* from regexec.c */
- SAVEI8(PL_reg_match_utf8); /* from regexec.c */
+ SAVEBOOL(PL_reg_match_utf8); /* from regexec.c */
SAVEVPTR(PL_reg_magic); /* from regexec.c */
SAVEI32(PL_reg_oldpos); /* from regexec.c */
SAVEVPTR(PL_reg_oldcurpm); /* from regexec.c */
diff --git a/scope.c b/scope.c
index 8691057527..0896bd49dc 100644
--- a/scope.c
+++ b/scope.c
@@ -391,6 +391,15 @@ Perl_save_long(pTHX_ long int *longp)
}
void
+Perl_save_bool(pTHX_ bool *boolp)
+{
+ SSCHECK(3);
+ SSPUSHBOOL(*boolp);
+ SSPUSHPTR(boolp);
+ SSPUSHINT(SAVEt_BOOL);
+}
+
+void
Perl_save_I32(pTHX_ I32 *intp)
{
SSCHECK(3);
@@ -789,6 +798,10 @@ Perl_leave_scope(pTHX_ I32 base)
ptr = SSPOPPTR;
*(long*)ptr = (long)SSPOPLONG;
break;
+ case SAVEt_BOOL: /* bool reference */
+ ptr = SSPOPPTR;
+ *(bool*)ptr = (bool)SSPOPBOOL;
+ break;
case SAVEt_I32: /* I32 reference */
ptr = SSPOPPTR;
*(I32*)ptr = (I32)SSPOPINT;
diff --git a/scope.h b/scope.h
index b15e5f1d2b..9a24ac9622 100644
--- a/scope.h
+++ b/scope.h
@@ -45,6 +45,7 @@
#define SAVEt_PADSV 35
#define SAVEt_MORTALIZESV 36
#define SAVEt_SHARED_PVREF 37
+#define SAVEt_BOOL 38
#ifndef SCOPE_SAVES_SIGNAL_MASK
#define SCOPE_SAVES_SIGNAL_MASK 0
@@ -53,12 +54,14 @@
#define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow()
#define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i))
#define SSPUSHLONG(i) (PL_savestack[PL_savestack_ix++].any_long = (long)(i))
+#define SSPUSHBOOL(p) (PL_savestack[PL_savestack_ix++].any_bool = (p))
#define SSPUSHIV(i) (PL_savestack[PL_savestack_ix++].any_iv = (IV)(i))
#define SSPUSHPTR(p) (PL_savestack[PL_savestack_ix++].any_ptr = (void*)(p))
#define SSPUSHDPTR(p) (PL_savestack[PL_savestack_ix++].any_dptr = (p))
#define SSPUSHDXPTR(p) (PL_savestack[PL_savestack_ix++].any_dxptr = (p))
#define SSPOPINT (PL_savestack[--PL_savestack_ix].any_i32)
#define SSPOPLONG (PL_savestack[--PL_savestack_ix].any_long)
+#define SSPOPBOOL (PL_savestack[--PL_savestack_ix].any_bool)
#define SSPOPIV (PL_savestack[--PL_savestack_ix].any_iv)
#define SSPOPPTR (PL_savestack[--PL_savestack_ix].any_ptr)
#define SSPOPDPTR (PL_savestack[--PL_savestack_ix].any_dptr)
@@ -116,6 +119,7 @@ Closing bracket on a callback. See C<ENTER> and L<perlcall>.
#define SAVEINT(i) save_int(SOFT_CAST(int*)&(i))
#define SAVEIV(i) save_iv(SOFT_CAST(IV*)&(i))
#define SAVELONG(l) save_long(SOFT_CAST(long*)&(l))
+#define SAVEBOOL(b) save_bool(SOFT_CAST(bool*)&(b))
#define SAVESPTR(s) save_sptr((SV**)&(s))
#define SAVEPPTR(s) save_pptr(SOFT_CAST(char**)&(s))
#define SAVEVPTR(s) save_vptr((void*)&(s))