platform/upstream/perl.git
12 years agoregexec.c: Safer stack handling for re-evals
Father Chrysostomos [Tue, 13 Nov 2012 17:10:09 +0000 (09:10 -0800)]
regexec.c: Safer stack handling for re-evals

I don’t believe there is an actual bug here (only a theoretical one), but comparing pointers into an array that has been reallocated meanwhile is not a good idea.

12 years agoSilence two build warnings on systems where ivsize > ptrsize.
Eric Brine\" (via RT) [Tue, 13 Nov 2012 10:42:47 +0000 (02:42 -0800)]
Silence two build warnings on systems where ivsize > ptrsize.

# New Ticket Created by  "Eric Brine"
# Please include the string:  [perl #115710]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=115710 >

This is a bug report for perl from ikegami@adaelis.com,
generated with the help of perlbug 1.39 running under perl 5.14.2.

-----------------------------------------------------------------
[Please describe your issue here]

Attached patch silences two build warnings on systems where ivsize >
ptrsize.

They are safe to ignore, a side-effect of a function with a polymorphic
interface.

cv = find_runcv_where(FIND_RUNCV_level_eq, iv,        NULL);
cv = find_runcv_where(FIND_RUNCV_padid_eq, PTR2IV(p), NULL);  // p is a
PADNAMELIST*

[Please do not change anything below this line]
-----------------------------------------------------------------

12 years agoleakfinder.pl: More exceptions
Father Chrysostomos [Tue, 13 Nov 2012 08:00:45 +0000 (00:00 -0800)]
leakfinder.pl: More exceptions

12 years agoleakfinder.pl: Run code more times
Father Chrysostomos [Tue, 13 Nov 2012 07:46:16 +0000 (23:46 -0800)]
leakfinder.pl: Run code more times

Sometimes a piece of code will still create new SVs on the second
or even the third iteration, but not after that.  That doesn’t count
as a leak.

12 years agoDo a better job of escaping components of ldlibpth for the shell
Eric Brine [Tue, 13 Nov 2012 00:40:49 +0000 (19:40 -0500)]
Do a better job of escaping components of ldlibpth for the shell

It's not unusual, for example, for the search path to include "(" and ")" in cygwin.

12 years agoPrune dead code in pp_ctl.c:pp_goto
Father Chrysostomos [Tue, 13 Nov 2012 07:11:34 +0000 (23:11 -0800)]
Prune dead code in pp_ctl.c:pp_goto

We croak if CxTYPE(cx) == CXt_EVAL before reaching the code
in question.

12 years agoDon’t leak subs containing syntax errors
Father Chrysostomos [Tue, 13 Nov 2012 07:04:16 +0000 (23:04 -0800)]
Don’t leak subs containing syntax errors

I fixed this for BEGIN blocks earlier, but missed the fact that
all subs are affected.

When called without an o argument (from newANONATTRSUB), newATTRSUB
is expected to return a CV with an unowned reference count of which
the caller will take ownership.  We cannot have newATTRSUB returning
a freed CV, so we have it return null instead.  But that means
ck_anoncode and pm_runtime have to account for that.

12 years agoStop anon subs with bad attributes from leaking
Father Chrysostomos [Tue, 13 Nov 2012 04:10:56 +0000 (20:10 -0800)]
Stop anon subs with bad attributes from leaking

12 years agoStop goto &sub from leaking when it croaks
Father Chrysostomos [Tue, 13 Nov 2012 00:04:07 +0000 (16:04 -0800)]
Stop goto &sub from leaking when it croaks

12 years agoUpdate IO-Compress to CPAN version 2.058
Chris 'BinGOs' Williams [Mon, 12 Nov 2012 23:49:19 +0000 (23:49 +0000)]
Update IO-Compress to CPAN version 2.058

  [DELTA]

  2.058 12 November 2012

      * RT# 81119: Latest IO::Compress 2.057 fails tests on 5.8.x

12 years agoUpdate Compress-Raw-Bzip2 to CPAN version 2.058
Chris 'BinGOs' Williams [Mon, 12 Nov 2012 23:46:12 +0000 (23:46 +0000)]
Update Compress-Raw-Bzip2 to CPAN version 2.058

  [DELTA]

  2.058 12 November 2012

      * No Changes

12 years agoUpdate Compress-Raw-Zlib to CPAN version 2.058
Chris 'BinGOs' Williams [Mon, 12 Nov 2012 23:44:13 +0000 (23:44 +0000)]
Update Compress-Raw-Zlib to CPAN version 2.058

  [DELTA]

  2.058 12 November 2012

      * No Changes

12 years agoAdd Tom Wyant’s e-mail to AUTHORS
Father Chrysostomos [Mon, 12 Nov 2012 20:45:43 +0000 (12:45 -0800)]
Add Tom Wyant’s e-mail to AUTHORS

12 years agoperlvar: two spaces after dots
Father Chrysostomos [Mon, 12 Nov 2012 20:42:55 +0000 (12:42 -0800)]
perlvar: two spaces after dots

12 years agoDocumentation of non-handle IO::Handle methods in perlvar.pod
Tom Wyant [Mon, 12 Nov 2012 20:41:38 +0000 (12:41 -0800)]
Documentation of non-handle IO::Handle methods in perlvar.pod

The documentation to IO::Handle says that certain methods may not be set
on file handles, only statically. It would be nice (in my perhaps
not-so-humble opinion) if the distinction between per-filehandle and
non-perl-filehandle methods were recognized in perlvar.pod. The appended
universal diff is my cut at this.

diff a/pod/perlvar.pod b/pod/perlvar.pod

12 years agopv->pvn for literals in pp_require and Perl_sv_derived_from_pvn
Daniel Dragan [Mon, 12 Nov 2012 16:08:44 +0000 (11:08 -0500)]
pv->pvn for literals in pp_require and Perl_sv_derived_from_pvn

I found these 2 strlens while stepping through the interp while running a
script and both came from a pp_require. UNIVERSAL::can was not modified
since it is more rarely called than pp_require. A better more through
investigation of version obj comparison and upgrading will need to be done
in the future (new funcs needed for the derived/upg_version idiom, remove
the upg_version since it was changed to always be a ver obj, etc).

12 years agofix typo in comment
Lukas Mai [Mon, 12 Nov 2012 17:21:28 +0000 (18:21 +0100)]
fix typo in comment

12 years agomore dTHX optimizations
Daniel Dragan [Mon, 12 Nov 2012 08:22:12 +0000 (03:22 -0500)]
more dTHX optimizations

Either delay fetching of the context, or move the declaration close to the
first usage point, or remove the dependency on a context.

12 years agoadd items checking to Internals::SvREFCNT
Daniel Dragan [Sat, 10 Nov 2012 17:49:38 +0000 (12:49 -0500)]
add items checking to Internals::SvREFCNT

Add item count checking to Internals::SvREFCNT in case prototype is
bypassed. Getting rid of the undef saves some instructions. Reading
SvREFCNT(sv) only once save an instruction.

12 years agoclean up the users of PL_no_mem
Daniel Dragan [Mon, 12 Nov 2012 14:19:10 +0000 (06:19 -0800)]
clean up the users of PL_no_mem

This commit eliminates a couple strlen()s of a literal. "Out of memory!\n"
and PL_no_mem did not string pool on Visual C, so PL_no_mem was given a
length. This commit removes S_write_no_mem and replaces it with nonstatic.
Perl_croak_no_mem was made nocontext to save instructions in it's callers.
NORETURN_FUNCTION_END caused a syntax error on Visual C C++ mode and
therefore was removed.

12 years agoMerge branch 'debugger-refactoring' into blead
Ricardo Signes [Mon, 12 Nov 2012 14:21:01 +0000 (09:21 -0500)]
Merge branch 'debugger-refactoring' into blead

12 years agoSmall cleanups.
Shlomi Fish [Wed, 7 Nov 2012 22:37:51 +0000 (00:37 +0200)]
Small cleanups.

12 years agoConvert to a lexical file handle.
Shlomi Fish [Sat, 3 Nov 2012 20:47:49 +0000 (22:47 +0200)]
Convert to a lexical file handle.

12 years ago[perl5db] unless+eq --> ne.
Shlomi Fish [Mon, 29 Oct 2012 09:08:54 +0000 (11:08 +0200)]
[perl5db] unless+eq --> ne.

12 years ago[perl5db] Refactored cmd_b_sub.
Shlomi Fish [Mon, 29 Oct 2012 08:56:53 +0000 (10:56 +0200)]
[perl5db] Refactored cmd_b_sub.

12 years agoperl5db: extract some subroutines.
Shlomi Fish [Thu, 25 Oct 2012 16:47:09 +0000 (18:47 +0200)]
perl5db: extract some subroutines.

12 years agoExtract a closure.
Shlomi Fish [Thu, 25 Oct 2012 16:29:25 +0000 (18:29 +0200)]
Extract a closure.

12 years agoConvert DB::system to _db_system.
Shlomi Fish [Wed, 17 Oct 2012 16:04:10 +0000 (18:04 +0200)]
Convert DB::system to _db_system.

12 years agoRemove some declared but unused lexicals.
Shlomi Fish [Wed, 17 Oct 2012 15:48:37 +0000 (17:48 +0200)]
Remove some declared but unused lexicals.

12 years agoConvert from DB::warn to _db_warn.
Shlomi Fish [Wed, 17 Oct 2012 15:37:51 +0000 (17:37 +0200)]
Convert from DB::warn to _db_warn.

This way we are not abusing a built-in. The old DB::warn was kept in for
backwards compatibility.

12 years agoGot rid of leading ampersands in sub calls.
Shlomi Fish [Wed, 17 Oct 2012 14:48:23 +0000 (16:48 +0200)]
Got rid of leading ampersands in sub calls.

12 years agoFinish the refactoring into cmd_verb and cmd_args.
Shlomi Fish [Tue, 16 Oct 2012 15:48:35 +0000 (17:48 +0200)]
Finish the refactoring into cmd_verb and cmd_args.

12 years agoConvert up to _DB__handle_y_command to cmd_args.
Shlomi Fish [Tue, 16 Oct 2012 09:05:10 +0000 (11:05 +0200)]
Convert up to _DB__handle_y_command to cmd_args.

12 years agoConvert more to the ->cmd_args() method.
Shlomi Fish [Tue, 16 Oct 2012 08:50:03 +0000 (10:50 +0200)]
Convert more to the ->cmd_args() method.

12 years agoExtract _is_full().
Shlomi Fish [Mon, 15 Oct 2012 18:48:12 +0000 (20:48 +0200)]
Extract _is_full().

12 years agoMore refactoring into cmd_args.
Shlomi Fish [Mon, 15 Oct 2012 17:53:27 +0000 (19:53 +0200)]
More refactoring into cmd_args.

12 years agoRefactor some more command-handlers.
Shlomi Fish [Mon, 15 Oct 2012 15:34:00 +0000 (17:34 +0200)]
Refactor some more command-handlers.

12 years agoStart converting to cmd_args.
Shlomi Fish [Mon, 15 Oct 2012 14:57:44 +0000 (16:57 +0200)]
Start converting to cmd_args.

This is the string of arguments that follows the verb of the command,
and can be used instead of matching the command again.

12 years agoRefactoring: more renaming and lexicalising.
Shlomi Fish [Mon, 15 Oct 2012 10:28:29 +0000 (12:28 +0200)]
Refactoring: more renaming and lexicalising.

Some variables need not be placed inside cmd_verb.

12 years agoRename "i" as cmd_verb.
Shlomi Fish [Mon, 15 Oct 2012 10:14:30 +0000 (12:14 +0200)]
Rename "i" as cmd_verb.

It is a more representative name.

12 years agoPass $obj to _DB__trim_command*.
Shlomi Fish [Mon, 15 Oct 2012 10:03:39 +0000 (12:03 +0200)]
Pass $obj to _DB__trim_command*.

We are about to enhance it with further enhancements.

12 years ago_handle_cmd_wrapper_commands to %cmd_lookup.
Shlomi Fish [Sun, 14 Oct 2012 14:32:47 +0000 (16:32 +0200)]
_handle_cmd_wrapper_commands to %cmd_lookup.

This is part of the ongoing perl5db.pl refactoring.

12 years agoRemove extraneous =cut-s from the POD.
Shlomi Fish [Sun, 14 Oct 2012 11:36:47 +0000 (13:36 +0200)]
Remove extraneous =cut-s from the POD.

12 years agoLow hanging fruit is now in %cmd_lookup.
Shlomi Fish [Sun, 14 Oct 2012 11:22:45 +0000 (13:22 +0200)]
Low hanging fruit is now in %cmd_lookup.

12 years agoMove more commands to the dispatch.
Shlomi Fish [Sun, 14 Oct 2012 11:09:05 +0000 (13:09 +0200)]
Move more commands to the dispatch.

12 years agoAdd more commands to the lookup table.
Shlomi Fish [Sun, 14 Oct 2012 10:56:53 +0000 (12:56 +0200)]
Add more commands to the lookup table.

12 years agoStart converting to %cmd_lookup.
Shlomi Fish [Sun, 14 Oct 2012 10:35:19 +0000 (12:35 +0200)]
Start converting to %cmd_lookup.

This is a dispatch table for the commands based on their command
component.

12 years agoPass $obj to _DB__handle_f_command.
Shlomi Fish [Sun, 14 Oct 2012 10:04:31 +0000 (12:04 +0200)]
Pass $obj to _DB__handle_f_command.

For consistency with the other commands.

12 years agoExtract _handle_cmd_wrapper_commands.
Shlomi Fish [Sat, 13 Oct 2012 18:25:28 +0000 (20:25 +0200)]
Extract _handle_cmd_wrapper_commands.

12 years agoExtract _handle_q_command .
Shlomi Fish [Sat, 13 Oct 2012 17:36:17 +0000 (19:36 +0200)]
Extract _handle_q_command .

12 years agoExtract the CMD: continue() into a subroutine.
Shlomi Fish [Thu, 11 Oct 2012 13:33:57 +0000 (15:33 +0200)]
Extract the CMD: continue() into a subroutine.

12 years agoExtract _DB__handle_m_command.
Shlomi Fish [Thu, 11 Oct 2012 12:22:47 +0000 (14:22 +0200)]
Extract _DB__handle_m_command.

12 years agoExtract _handle_x_command.
Shlomi Fish [Thu, 11 Oct 2012 09:14:18 +0000 (11:14 +0200)]
Extract _handle_x_command.

12 years agoConvert from ^ to \A.
Shlomi Fish [Thu, 11 Oct 2012 08:29:36 +0000 (10:29 +0200)]
Convert from ^ to \A.

This is part of the debugger refactoring.

12 years agoFix indentation.
Shlomi Fish [Wed, 10 Oct 2012 19:37:57 +0000 (21:37 +0200)]
Fix indentation.

12 years agoperl5db: &cmd_wrapper -> cmd_wrapper().
Shlomi Fish [Wed, 10 Oct 2012 19:26:21 +0000 (21:26 +0200)]
perl5db: &cmd_wrapper -> cmd_wrapper().

Leading ampersand is not needed.

12 years agoCorrect a bug with #g in list context.
Shlomi Fish [Wed, 10 Oct 2012 18:51:51 +0000 (20:51 +0200)]
Correct a bug with #g in list context.

It does not work properly there - one should use $1 / etc.

12 years agoperl5db: extract more into _handle_sh_command.
Shlomi Fish [Wed, 10 Oct 2012 18:13:46 +0000 (20:13 +0200)]
perl5db: extract more into _handle_sh_command.

12 years agoavoid overriding prototypes when the call can be fixed
Ricardo Signes [Wed, 10 Oct 2012 01:57:14 +0000 (21:57 -0400)]
avoid overriding prototypes when the call can be fixed

We don't need to call share with an ampersand.  We can just call it in
the way its prototype implies.  While we're at it, we can fix the
prototype that we use when threads::shared can't be loaded.  Also,
there's no need to fake up lock, because it's already a do-nothing weak
keyword without threads.

12 years agocorrect the documented value of ${"_<$fn"}
Ricardo Signes [Tue, 9 Oct 2012 14:47:24 +0000 (10:47 -0400)]
correct the documented value of ${"_<$fn"}

12 years agofix two small typos in MANIFEST updates
Ricardo Signes [Tue, 9 Oct 2012 14:47:10 +0000 (10:47 -0400)]
fix two small typos in MANIFEST updates

12 years agoAdd ampersand to share.
Shlomi Fish [Tue, 9 Oct 2012 18:58:45 +0000 (20:58 +0200)]
Add ampersand to share.

We need it to override the prototype and pass a variable by reference.

Thanks to RJBS who reported that. That fixed the tests with -Dusethreads
(thanks to Leon Timmermans).

12 years agoperl5db: extract _handle_sh_sh_command().
Shlomi Fish [Tue, 9 Oct 2012 16:50:42 +0000 (18:50 +0200)]
perl5db: extract _handle_sh_sh_command().

12 years agoGet rid of a leading ampersand.
Shlomi Fish [Mon, 8 Oct 2012 17:59:00 +0000 (19:59 +0200)]
Get rid of a leading ampersand.

12 years agoRefactoring - merged the two n/s cases.
Shlomi Fish [Mon, 8 Oct 2012 17:40:48 +0000 (19:40 +0200)]
Refactoring - merged the two n/s cases.

12 years agoExtract a common method.
Shlomi Fish [Mon, 8 Oct 2012 13:32:24 +0000 (15:32 +0200)]
Extract a common method.

12 years agoExtract _handle_[sn]_and_arg_commands.
Shlomi Fish [Mon, 8 Oct 2012 13:15:07 +0000 (15:15 +0200)]
Extract _handle_[sn]_and_arg_commands.

12 years ago[perl5db] Remove unnecessary code.
Shlomi Fish [Sun, 7 Oct 2012 22:12:13 +0000 (00:12 +0200)]
[perl5db] Remove unnecessary code.

We already handled the "t" command. This was detected during
refactoring.

12 years agoExtract _DB__handle_run_command_in_pager_command.
Shlomi Fish [Sun, 7 Oct 2012 13:26:57 +0000 (15:26 +0200)]
Extract _DB__handle_run_command_in_pager_command.

12 years agoExtract _DB__handle_restart_and_rerun_commands().
Shlomi Fish [Sun, 7 Oct 2012 10:51:20 +0000 (12:51 +0200)]
Extract _DB__handle_restart_and_rerun_commands().

12 years agoExtract _handle_save_command.
Shlomi Fish [Sun, 7 Oct 2012 10:41:36 +0000 (12:41 +0200)]
Extract _handle_save_command.

12 years agoExtract _handle_enable_disable_commands .
Shlomi Fish [Sun, 7 Oct 2012 10:33:12 +0000 (12:33 +0200)]
Extract _handle_enable_disable_commands .

12 years agoExtract _handle_source_command.
Shlomi Fish [Sun, 7 Oct 2012 10:11:45 +0000 (12:11 +0200)]
Extract _handle_source_command.

12 years ago[perl5db] Extract _handle_equal_sign_command .
Shlomi Fish [Sun, 7 Oct 2012 10:01:21 +0000 (12:01 +0200)]
[perl5db] Extract _handle_equal_sign_command .

12 years agoExtract _handle_p_command.
Shlomi Fish [Sat, 6 Oct 2012 14:47:39 +0000 (16:47 +0200)]
Extract _handle_p_command.

12 years agoExtract _handle_doc_command.
Shlomi Fish [Sat, 6 Oct 2012 14:23:35 +0000 (16:23 +0200)]
Extract _handle_doc_command.

12 years ago[perl5db] Extract _handle_H_command.
Shlomi Fish [Sat, 6 Oct 2012 12:33:41 +0000 (14:33 +0200)]
[perl5db] Extract _handle_H_command.

12 years ago[perldb] Extract _handle_rc_search_history_command.
Shlomi Fish [Sat, 6 Oct 2012 11:33:34 +0000 (13:33 +0200)]
[perldb] Extract _handle_rc_search_history_command.

12 years agoAdd quotes.
Shlomi Fish [Sat, 6 Oct 2012 11:19:27 +0000 (13:19 +0200)]
Add quotes.

Without quotes the vim syntax was broken.

12 years ago[perl5db] Get rid of leading ampersands.
Shlomi Fish [Sat, 6 Oct 2012 11:04:39 +0000 (13:04 +0200)]
[perl5db] Get rid of leading ampersands.

12 years ago[perl5db] Avoid some trailing expressions.
Shlomi Fish [Fri, 5 Oct 2012 14:48:46 +0000 (16:48 +0200)]
[perl5db] Avoid some trailing expressions.

12 years ago[perl5db] Remove leading ampersands in sub call.
Shlomi Fish [Fri, 5 Oct 2012 14:28:25 +0000 (16:28 +0200)]
[perl5db] Remove leading ampersands in sub call.

12 years agoAdd a reminder comment;
Shlomi Fish [Fri, 5 Oct 2012 11:07:11 +0000 (13:07 +0200)]
Add a reminder comment;

12 years agoExtract _handle_rc_recall_command.
Shlomi Fish [Fri, 5 Oct 2012 10:59:48 +0000 (12:59 +0200)]
Extract _handle_rc_recall_command.

12 years agoExtract _DB__handle_question_mark_command() .
Shlomi Fish [Fri, 5 Oct 2012 09:40:34 +0000 (11:40 +0200)]
Extract _DB__handle_question_mark_command() .

12 years agoExtract _DB__handle_forward_slash_command().
Shlomi Fish [Fri, 5 Oct 2012 09:16:32 +0000 (11:16 +0200)]
Extract _DB__handle_forward_slash_command().

Converted away from string eval in the process.

12 years agoExtract _handle_W_command .
Shlomi Fish [Fri, 5 Oct 2012 06:01:50 +0000 (08:01 +0200)]
Extract _handle_W_command .

12 years agoExtract _handle_w_command.
Shlomi Fish [Fri, 5 Oct 2012 05:54:30 +0000 (07:54 +0200)]
Extract _handle_w_command.

12 years agoExtract _handle_T_command.
Shlomi Fish [Fri, 5 Oct 2012 05:43:31 +0000 (07:43 +0200)]
Extract _handle_T_command.

12 years ago[perl5db] Extract _handle_r_command.
Shlomi Fish [Thu, 4 Oct 2012 18:29:48 +0000 (20:29 +0200)]
[perl5db] Extract _handle_r_command.

12 years ago[perl5db] Extract _handle_c_command.
Shlomi Fish [Thu, 4 Oct 2012 18:09:40 +0000 (20:09 +0200)]
[perl5db] Extract _handle_c_command.

12 years agoExtract _handle_s_command and refactored.
Shlomi Fish [Thu, 4 Oct 2012 17:42:08 +0000 (19:42 +0200)]
Extract _handle_s_command and refactored.

12 years ago[perl5db] Extract _handle_n_command.
Shlomi Fish [Thu, 4 Oct 2012 17:30:17 +0000 (19:30 +0200)]
[perl5db] Extract _handle_n_command.

12 years agoExtract _DB__handle_y_command .
Shlomi Fish [Thu, 4 Oct 2012 17:16:28 +0000 (19:16 +0200)]
Extract _DB__handle_y_command .

12 years ago[perl5db] Extract $obj->_handle_dash_command.
Shlomi Fish [Thu, 4 Oct 2012 17:03:57 +0000 (19:03 +0200)]
[perl5db] Extract $obj->_handle_dash_command.

12 years ago[perl5db] Extract another function.
Shlomi Fish [Thu, 4 Oct 2012 16:41:13 +0000 (18:41 +0200)]
[perl5db] Extract another function.

12 years agoExtract _DB__handle_f_command.
Shlomi Fish [Thu, 4 Oct 2012 14:38:45 +0000 (16:38 +0200)]
Extract _DB__handle_f_command.

12 years agoExtract _handle_V_command_and_X_command.
Shlomi Fish [Wed, 3 Oct 2012 13:28:29 +0000 (15:28 +0200)]
Extract _handle_V_command_and_X_command.

12 years agoExtract _handle_S_command.
Shlomi Fish [Wed, 3 Oct 2012 13:04:43 +0000 (15:04 +0200)]
Extract _handle_S_command.

12 years agoFix "a [command]" statement.
Shlomi Fish [Wed, 3 Oct 2012 12:28:28 +0000 (14:28 +0200)]
Fix "a [command]" statement.

Without a line number. See:

https://rt.perl.org/rt3/Ticket/Display.html?id=115110 .