ruby-changes:53434
From: nobu <ko1@a...>
Date: Sat, 10 Nov 2018 18:29:04 +0900 (JST)
Subject: [ruby-changes:53434] nobu:r65650 (trunk): Fix potential NULL pointer access [ci skip]
nobu 2018-11-10 18:29:00 +0900 (Sat, 10 Nov 2018) New Revision: 65650 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65650 Log: Fix potential NULL pointer access [ci skip] Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 65649) +++ compile.c (revision 65650) @@ -1406,6 +1406,7 @@ static int https://github.com/ruby/ruby/blob/trunk/compile.c#L1406 get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls) { int lv = 0, idx = -1; + const rb_iseq_t *const topmost_iseq = iseq; while (iseq) { idx = get_dyna_var_idx_at_raw(iseq, id); @@ -1417,7 +1418,7 @@ get_dyna_var_idx(const rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L1418 } if (idx < 0) { - COMPILE_ERROR(iseq, ISEQ_LAST_LINE(iseq), + COMPILE_ERROR(topmost_iseq, ISEQ_LAST_LINE(topmost_iseq), "get_dyna_var_idx: -1"); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/