Граф коммитов

26563 Коммитов

Автор SHA1 Сообщение Дата
akr 37a1355bf8 * include/ruby/intern.h (rb_exec_arg_init): deprecated.
(rb_exec_arg_addopt): ditto.
  (rb_exec_arg_fixup): ditto.
  (rb_run_exec_options): ditto.
  (rb_run_exec_options_err): ditto.

* internal.h (rb_execarg_init): declared.
  (rb_execarg_addopt): ditto.
  (rb_execarg_fixup): ditto.
  (rb_execarg_run_options): ditto.

* process.c: call rb_execarg_addopt, rb_execarg_fixup,
  rb_execarg_run_options, rb_execarg_init.
  (rb_execarg_addopt): renamed from rb_exec_arg_addopt.
  (rb_exec_arg_addopt): stub to call rb_execarg_addopt.
  (rb_execarg_init): renamed from rb_exec_arg_init.
  (rb_exec_arg_init): stub to call rb_execarg_init.
  (rb_execarg_fixup): renamed from rb_exec_arg_fixup.
  (rb_exec_arg_fixup): stub to call rb_execarg_fixup.
  (rb_execarg_run_options): renamed from rb_run_exec_options_err.
  (rb_run_exec_options_err): stub to call rb_execarg_run_options.
  (rb_run_exec_options): call rb_execarg_run_options.

* io.c: call rb_execarg_addopt, rb_execarg_fixup,
  rb_execarg_run_options, rb_execarg_init.

* ext/pty/pty.c (establishShell): call rb_execarg_init and
  rb_execarg_fixup.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12 11:34:51 +00:00
shyouhei 0284e64922 * configure.in: enable strict ANSI mode by default in case of GCC,
requested by _ko1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12 09:41:07 +00:00
svn aa56c127b5 * 2012-06-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 21:40:57 +00:00
akr 45e5f2f690 * process.c (rb_exec_fillarg): detect '#' as a meta character.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 21:40:50 +00:00
akr a903db9c23 * include/ruby/intern.h (rb_proc_exec_n): deprecated.
(rb_exec): ditto.
  (rb_exec_err): ditto.
  (rb_fork): ditto.
  (rb_fork_err): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 13:16:36 +00:00
akr 05a98ce736 update tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 12:58:55 +00:00
akr ffe89b7621 add comment about meta characters.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 12:37:55 +00:00
naruse f658207fe3 * configure.in: on checking libexecinfo, don't specify /use/local.
On FreeBSD people must specify --with-opt-dir or --with-execinfo-dir.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 11:27:08 +00:00
ko1 0a71db8a74 * vm_core.h: remove lfp (local frame pointer) and rename
dfp (dynamic frame pointer) to ep (environment pointer).
  This change make VM `normal' (similar to other interpreters).
  Before this commit:
  Each frame has two env pointers lfp and dfp.  lfp points
  local environment which is method/class/toplevel frame.
  lfp[0] is block pointer.
  dfp is block local frame. dfp[0] points previous (parent)
  environment pointer.
  lfp == dfp when frame is method/class/toplevel.
  You can get lfp from dfp by traversing previous environment
  pointers.
  After this commit:
  Each frame has only `ep' to point respective enviornoment.
  If there is parent environment, then ep[0] points parent
  envioenment (as dfp).  If there are no more environment,
  then ep[0] points block pointer (as lfp).  We call such ep
  as `LEP' (local EP).  We add some macros to get LEP and to
  detect LEP or not.
  In short, we replace dfp and lfp with ep and LEP.
  rb_block_t and rb_binding_t member `lfp' and `dfp' are removed
  and member `ep' is added.
  rename rb_thread_t's member `local_lfp' and `local_svar' to
  `root_lep' and `root_svar'.
  (VM_EP_PREV_EP(ep)): get previous environment pointer.  This macro
  assume that ep is not LEP.
  (VM_EP_BLOCK_PTR(ep)): get block pointer.  This macro assume
  that ep is LEP.
  (VM_EP_LEP_P(ep)): detect ep is LEP or not.
  (VM_ENVVAL_BLOCK_PTR(ptr)): make block pointer.
  (VM_ENVVAL_BLOCK_PTR_P(v)): detect v is block pointer.
  (VM_ENVVAL_PREV_EP_PTR(ptr)): make prev environment pointer.
  (VM_ENVVAL_PREV_EP_PTR_P(v)): detect v is prev env pointer.
* vm.c: apply above changes.
  (VM_EP_LEP(ep)): get LEP.
  (VM_CF_LEP(cfp)): get LEP of cfp->ep.
  (VM_CF_PREV_EP(cfp)): utility function VM_EP_PREV_EP(cfp->ep).
  (VM_CF_BLOCK_PTR(cfp)): utility function VM_EP_BLOCK_PTR(cfp->ep).
* vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, insns.def:
  apply above changes.
* cont.c: ditto.
* eval.c, eval_intern.h: ditto.
* proc.c: ditto.
* thread.c: ditto.
* vm_dump.c: ditto.
* vm_exec.h: fix function name (on vm debug mode).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 03:14:59 +00:00
shyouhei 9b29e5f7e1 * compile.c (iseq_set_sequence): nonstatic initializer of an
aggregate type is a C99ism.

	* compile.c (enum compile_array_type_t): comma at the end of enum
	  list is a C99ism.

	* vm_backtrace.c (enum LOCATION_TYPE): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 02:57:02 +00:00
akr 9ea35ccf30 * process.c (rb_proc_exec_n): revert the function removed at r35889.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 21:31:49 +00:00
naruse 35973f273c * thread_pthread.c (rb_thread_create_timer_thread): assign return
value to the variable err.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 21:21:51 +00:00
naruse 67b8c950bf * thread_pthread.c (native_cond_initialize): fix typo in r36022.
this cause a failure on FreeBSD 8.2 amd64.
  http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20120610T130201Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 21:19:07 +00:00
svn cf8c5c1405 * 2012-06-11
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 20:24:47 +00:00
ko1 574024147b * .gdbinit (SDR): add SDR function. It's only for VM debugging.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 20:24:43 +00:00
yugui cc4072b3db * nacl/nacl_config.rb: Fixed for 32bit hosts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 12:51:40 +00:00
yugui c3f3d77225 Fixes threading on NativeClient.
* thread_pthread.c (timer_thread_sleep): Extracted out a function from
  thread_timer(). Added an alternative implementation for platforms
  that lacks select(2) or pipe(2).
  (rb_thread_create_timer_thread, native_cond_initialize,
  native_cond_destroy): Replaced wrong HAVE_XXX checks.

* configure.in (pthread_attr_init): New check.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 12:51:37 +00:00
akr fa5cd00340 * process.c (rb_exec_without_timer_thread): renamed from rb_exec_err.
(rb_exec_err): new stub function to call
  rb_exec_without_timer_thread.
  (rb_f_exec): call rb_exec_without_timer_thread.
  (rb_exec): call rb_exec_without_timer_thread.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 12:31:40 +00:00
akr 4fa66dc53b * process.c (rb_fork): call rb_fork_internal instead of rb_fork_err.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 12:13:33 +00:00
akr f589733a02 * process.c (rb_fork_ruby): call rb_fork_internal directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 11:56:20 +00:00
akr 4b70fab915 * process.c (rb_fork_ruby): new function.
(rb_f_fork): use rb_fork_ruby instead of rb_fork.
  (rb_daemon): ditto.

* io.c (pipe_open): use rb_fork_ruby instead of rb_fork.

* internal.h (rb_fork_ruby): declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 11:21:07 +00:00
knu a9e8b77697 * lib/net/http/response.rb: Remove a duplicated rdoc and leave a
pointer.

* lib/net/http/responses.rb: Add RFC numbers to base on.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 09:59:59 +00:00
yugui c541ff3223 * configure.in (RUBY_NACL): Warns if $PATH does not contain the path
to NativeClient SDK. PATH variable redefinition in GNUmakefile does
  not work for GNU make 3.81.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 09:39:17 +00:00
nobu 8706c00dfd gc.h: IS_STACK_DIR_UPPER
* gc.h (IS_STACK_DIR_UPPER): utility macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 08:54:38 +00:00
nobu 068dafd21f thread_pthread.c: adjust stack size
* thread_pthread.c (get_stack): seems stack size does not include
  guard size on Mac OS X.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 08:54:32 +00:00
nobu 35c96b9003 thread_pthread.c: adjust stack size
* thread_pthread.c (ruby_init_stack): adjust stack size for offset of
  addr from the bottom.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 08:54:28 +00:00
akr 8fdd48d69f * process.c (retry_fork): call after_fork except in a child process.
(rb_fork_internal): restrict after_fork call condition.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 06:51:05 +00:00
nobu d9f3198dd9 * test/ruby/test_iseq.rb (TestISeq#test_disasm_encoding): set default
encoding not to be affected by environment variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 06:49:16 +00:00
naruse 5c45a1373a * configure.in: NetBSD 6 adds libexecinfo but it only works on amd64.
http://www.mail-archive.com/source-changes-full@netbsd.org/msg38729.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 05:28:51 +00:00
akr c39fd4c340 * process.c (rb_f_exec): call rb_exec_async_signal_safe except on
Mac OS X.  cf. the comment in before_exec_non_async_signal_safe.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 03:46:09 +00:00
akr c27edd4a6e * io.c (popen_exec): don't call rb_thread_atfork_before_exec. use
rb_exec_async_signal_safe instead of rb_exec_err.
  (pipe_open): use rb_fork_async_signal_safe instead of rb_fork_err.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 03:16:32 +00:00
akr 258716bd9d * process.c (rb_fork_internal): call after_fork only unless
chfunc_is_async_signal_safe.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 02:45:38 +00:00
emboss 3ffd8a918f * ext/openssl/ossl_pkey_ec.c
test/openssl/test_pkey_ec.rb: Add support for EC_POINT_mul.
  Patch provided by Sambasiva Suda. Thanks!
  [ruby-core:44408][ruby-trunk - Feature #6310]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 02:38:40 +00:00
emboss 43759fc1ed * lib/openssl/ssl.rb: Use a simple random number to generate the
session id. MD5, as was used before, causes problems when
  using a FIPS version of OpenSSL. Issue was found by Jared
  Jennings, thank you!
  [ruby-trunk - Bug #6137]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:53:20 +00:00
akr 839dc7d409 update async-signal-safe comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:46:45 +00:00
emboss 7db3bb5c8f * NEWS: Add note about the new private key export behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:31:06 +00:00
akr 18088467e7 * process.c (rb_exec_async_signal_safe): exported.
* ext/pty/extconf.rb: modify $INCFLAGS to include internal.h

* ext/pty/pty.c: include internal.h.
  (chfunc): don't call rb_thread_atfork_before_exec.  use
  rb_exec_async_signal_safe instead of rb_f_exec.
  (establishShell): set up earg.  use rb_fork_async_signal_safe
  instead of rb_fork_err.

* internal.h (rb_exec_async_signal_safe): declared.
  (rb_fork_async_signal_safe): declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:29:58 +00:00
emboss 5bd7899b98 * ext/openssl/ossl.c
ext/openssl/ossl_pkey_rsa.c
  ext/openssl/ossl_pkey_dsa.c
  ext/openssl/ossl_pkey_ec.c: Forbid export passwords that are less
  than four characters long, as OpenSSL itself does not allow this.
  Issue found by Eric Hodel.
* ext/openssl/ossl_pkey_ec.c: Add export as an alias of to_pem,
  following the PKey interface contract.
* test/openssl/test_pkey_dsa.rb
  test/openssl/test_pkey_rsa.rb
  test/openssl/test_pkey_ec.rb: Add tests that assert correct
  behaviour when dealing with passwords that are less than four
  characters long.
  [ruby-core: 42281][ruby-trunk - Bug #5951]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:23:21 +00:00
akr 8fcdb757a5 * process.c (rb_f_exec): use rb_exec_arg_prepare.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:17:53 +00:00
akr 99c71b1ee4 * process.c: split after_exec into async-signal-safe part and rest.
(after_exec_async_signal_safe): extracted from after_exec.
  (after_exec_non_async_signal_safe): ditto.
  (after_exec): call them.
  (rb_exec_async_signal_safe): call after_exec_async_signal_safe.
  (rb_exec_err): call after_exec_non_async_signal_safe instead of
  after_exec.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 21:48:42 +00:00
nobu e6424f805b * removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 21:36:05 +00:00
emboss f175918765 * NEWS: document new features of Ruby OpenSSL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 21:24:40 +00:00
emboss 21f1af2ec2 * ext/openssl/ossl.c: Fix error in example. Patch by David Albert.
Add/extend existing documentation. Examples now also cover RSA 
  signatures and PBKDF2.
  [ruby-core: 45154][ruby-trunk - Bug #6475]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 18:16:18 +00:00
emboss 14ba7fab58 * ext/openssl/ossl_ssl.c: Introduce SSLContext#renegotiation_cb and
remove SSLContext#disable_client_renegotiation and related
  functionality introduced in r35797. The new callback approach
  gives clients maximum flexibility to decide on their own what to
  do on renegotiation attempts.
  Add documentation for SSL module and SSLError. 
* test/openssl/test_ssl.rb: Add a test for
  SSLContext#renegotiation_cb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 16:44:12 +00:00
akr f45eb45100 * process.c (rb_fork_internal): initialize exc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 16:37:44 +00:00
svn 18d03a9eb5 * 2012-06-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 15:25:45 +00:00
akr b11046a61e * process.c: don't use non async-signal-safe functions in a child
process before exec, for invoking a command.
  (rb_exec_atfork): call rb_exec_async_signal_safe only.
  (retry_fork): take chfunc_is_async_signal_safe argument.  call
  before_fork and after_fork only unless chfunc_is_async_signal_safe.
  (send_child_error): take chfunc_is_async_signal_safe argument.
  send an exception only unless chfunc_is_async_signal_safe.
  (recv_child_error): take chfunc_is_async_signal_safe argument.
  receive an exception only unless chfunc_is_async_signal_safe.
  (rb_fork_internal): renamed from rb_fork_err and take
  chfunc_is_async_signal_safe argument.
  use rb_protect only unless chfunc_is_async_signal_safe.
  (rb_fork_err): call rb_fork_internal with false as
  chfunc_is_async_signal_safe.
  (rb_fork_async_signal_safe): call rb_fork_internal with true as
  chfunc_is_async_signal_safe.
  (rb_spawn_process): call rb_fork_async_signal_safe instead of
  rb_fork_err.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 15:25:34 +00:00
akr 14ec2c802d * process.c (rb_fork_err): rewrite a complex "if" statement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 14:58:03 +00:00
akr d074d0df95 * process.c (before_exec_async_signal_safe): extracted from
before_exec.
  (before_exec_non_async_signal_safe): ditto.
  (before_exec): call before_exec_async_signal_safe and
  before_exec_non_async_signal_safe.
  (rb_exec_async_signal_safe): call before_exec_async_signal_safe.
  (rb_exec_err): call before_exec_non_async_signal_safe instead of
  before_exec.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 14:45:46 +00:00
nobu a1d6532ef6 iseq.c: rb_id2str
* iseq.c (iseq_load, insn_operand_intern, rb_iseq_disasm)
  (rb_iseq_parameters): use rb_id2str() instead of rb_id2name() to
  keep encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09 14:36:56 +00:00