Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pos() uses sv_pos_b2u/sv_pos_u2b #10166

Closed
p5pRT opened this issue Feb 13, 2010 · 4 comments
Closed

pos() uses sv_pos_b2u/sv_pos_u2b #10166

p5pRT opened this issue Feb 13, 2010 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 13, 2010

Migrated from rt.perl.org#72766 (status was 'resolved')

Searchable as RT72766$

@p5pRT
Copy link
Author

p5pRT commented Feb 13, 2010

From @nwc10

mg.c
1935​: sv_pos_b2u(lsv, &i);
1995​: sv_pos_u2b(lsv, &p, 0);

pp.c
369​: sv_pos_b2u(sv, &i);

Perl_magic_getpos(), Perl_magic_setpos() and pp_pos respectively. This means
that reading and writing pos() will fail on UTF-8 strings over 2GB.

As PERL_MAGIC_regex_global is using mg_len, which is I32, likely the same
approach as Perl_av_iter_p() is needed - allocate mg_ptr on 64 bit systems.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2013

From @cpansprout

On Sat Feb 13 07​:43​:11 2010, nicholas wrote​:

mg.c
1935​: sv_pos_b2u(lsv, &i);
1995​: sv_pos_u2b(lsv, &p, 0);

pp.c
369​: sv_pos_b2u(sv, &i);

Perl_magic_getpos(), Perl_magic_setpos() and pp_pos respectively. This
means
that reading and writing pos() will fail on UTF-8 strings over 2GB.

I fixed this in commit 6174b39, but it is only part of the larger
puzzle, represented by #116907 and others.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2013

@cpansprout - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant