mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* iseq.c (proc_dup): don't duplicate sym_procs. [Fix GH-1479]
[ruby-core:78100] [Bug #12927] Based on the patch provided by Emiliano Ritiro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6b6368158d
commit
a5d754acb8
3 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Nov 19 14:06:07 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
|
||||
|
||||
* iseq.c (proc_dup): don't duplicate sym_procs. [Fix GH-1479]
|
||||
[ruby-core:78100] [Bug #12927]
|
||||
Based on the patch provided by Emiliano Ritiro.
|
||||
|
||||
Sat Nov 19 11:48:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* iseq.c (iseqw_s_compile_file): deal with syntax error as well as
|
||||
|
|
6
proc.c
6
proc.c
|
@ -65,11 +65,13 @@ typedef struct {
|
|||
VALUE env[3]; /* me, specval, envval */
|
||||
} cfunc_proc_t;
|
||||
|
||||
#define IS_SYM_PROC(proc) (proc->block.ep == ((const cfunc_proc_t *)proc)->env+1)
|
||||
|
||||
static size_t
|
||||
proc_memsize(const void *ptr)
|
||||
{
|
||||
const rb_proc_t *proc = ptr;
|
||||
if (proc->block.ep == ((const cfunc_proc_t *)ptr)->env+1)
|
||||
if (IS_SYM_PROC(proc))
|
||||
return sizeof(cfunc_proc_t);
|
||||
return sizeof(rb_proc_t);
|
||||
}
|
||||
|
@ -111,6 +113,8 @@ proc_dup(VALUE self)
|
|||
rb_proc_t *dst;
|
||||
|
||||
GetProcPtr(self, src);
|
||||
if (IS_SYM_PROC(src))
|
||||
return self;
|
||||
procval = rb_proc_alloc(rb_cProc);
|
||||
GetProcPtr(procval, dst);
|
||||
*dst = *src;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.3.3"
|
||||
#define RUBY_RELEASE_DATE "2016-11-19"
|
||||
#define RUBY_PATCHLEVEL 220
|
||||
#define RUBY_PATCHLEVEL 221
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2016
|
||||
#define RUBY_RELEASE_MONTH 11
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue