mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merges a part of r30840 from trunk into ruby_1_9_2.
-- * gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free. [ruby-core:35192] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3a5b7d3ac
commit
f2636ad40b
4 changed files with 10 additions and 3 deletions
|
|
@ -1,3 +1,10 @@
|
|||
Fri Feb 11 19:45:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval.c (ruby_cleanup): use rb_ary_free to free internal object.
|
||||
|
||||
* gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free.
|
||||
[ruby-core:35192]
|
||||
|
||||
Fri Feb 11 16:57:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_transcode.rb (test_from_cp50221): fix wrong
|
||||
|
|
|
|||
2
gc.h
2
gc.h
|
|
@ -58,7 +58,7 @@ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
|
|||
#endif
|
||||
|
||||
#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
|
||||
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);}
|
||||
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
|
||||
|
||||
#if STACK_GROW_DIRECTION > 0
|
||||
# define STACK_UPPER(x, a, b) a
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#define RUBY_VERSION "1.9.2"
|
||||
#define RUBY_PATCHLEVEL 198
|
||||
#define RUBY_PATCHLEVEL 199
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 9
|
||||
#define RUBY_VERSION_TEENY 1
|
||||
|
|
|
|||
2
vm.c
2
vm.c
|
|
@ -221,7 +221,7 @@ env_free(void * const ptr)
|
|||
{
|
||||
RUBY_FREE_ENTER("env");
|
||||
if (ptr) {
|
||||
const rb_env_t * const env = ptr;
|
||||
rb_env_t *const env = ptr;
|
||||
RUBY_FREE_UNLESS_NULL(env->env);
|
||||
ruby_xfree(ptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue