Skip to content

Commit

Permalink
* array.c (rb_ary_initialize): should call rb_ary_modify() first.
Browse files Browse the repository at this point in the history
	  [ruby-core:11562]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shyouhei committed Aug 22, 2007
1 parent 5a41ffc commit 7a62a9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Wed Aug 22 09:41:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>

* array.c (rb_ary_initialize): should call rb_ary_modify() first.
[ruby-core:11562]

Wed Aug 22 09:40:25 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>

* parse.y (yylex): return non-valid token for an invalid
Expand Down
2 changes: 1 addition & 1 deletion array.c
Expand Up @@ -272,6 +272,7 @@ rb_ary_initialize(argc, argv, ary)
long len;
VALUE size, val;

rb_ary_modify(ary);
if (rb_scan_args(argc, argv, "02", &size, &val) == 0) {
RARRAY(ary)->len = 0;
if (rb_block_given_p()) {
Expand All @@ -295,7 +296,6 @@ rb_ary_initialize(argc, argv, ary)
if (len > 0 && len * (long)sizeof(VALUE) <= len) {
rb_raise(rb_eArgError, "array size too big");
}
rb_ary_modify(ary);
if (len > RARRAY(ary)->aux.capa) {
REALLOC_N(RARRAY(ary)->ptr, VALUE, len);
RARRAY(ary)->aux.capa = len;
Expand Down
2 changes: 1 addition & 1 deletion version.h
Expand Up @@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-08-22"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070822
#define RUBY_PATCHLEVEL 52
#define RUBY_PATCHLEVEL 53

#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
Expand Down

0 comments on commit 7a62a9f

Please sign in to comment.