[前][次][番号順一覧][スレッド一覧]

ruby-changes:36776

From: nobu <ko1@a...>
Date: Tue, 16 Dec 2014 10:14:34 +0900 (JST)
Subject: [ruby-changes:36776] nobu:r48857 (trunk): compile.c: check funcptr

nobu	2014-12-16 10:14:20 +0900 (Tue, 16 Dec 2014)

  New Revision: 48857

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48857

  Log:
    compile.c: check funcptr
    
    * compile.c (iseq_build_from_ary_body): cannot load dumped funcptr.
    
    * iseq.c (iseq_data_to_ary): cannot dump funcptr.

  Modified files:
    trunk/compile.c
    trunk/iseq.c
Index: iseq.c
===================================================================
--- iseq.c	(revision 48856)
+++ iseq.c	(revision 48857)
@@ -1973,6 +1973,9 @@ iseq_data_to_ary(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1973
 		    rb_ary_push(ary, val);
 		}
 		break;
+	      case TS_FUNCPTR:
+		rb_ary_push(ary, Qnil);
+		break;
 	      default:
 		rb_bug("unknown operand: %c", insn_op_type(insn, j));
 	    }
Index: compile.c
===================================================================
--- compile.c	(revision 48856)
+++ compile.c	(revision 48857)
@@ -5950,6 +5950,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq https://github.com/ruby/ruby/blob/trunk/compile.c#L5950
 			}
 			break;
 		      case TS_FUNCPTR:
+			if (!RTEST(op)) rb_raise(rb_eArgError, "cannot load funcptr");
 			argv[j] = op;
 			break;
 		      default:

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]