ruby-changes:48799
From: ko1 <ko1@a...>
Date: Mon, 27 Nov 2017 09:43:30 +0900 (JST)
Subject: [ruby-changes:48799] ko1:r60915 (trunk): Relax `rb_bug()` condition.
ko1 2017-11-27 09:43:23 +0900 (Mon, 27 Nov 2017) New Revision: 60915 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60915 Log: Relax `rb_bug()` condition. * iseq.c (rb_iseq_trace_set): simply return immediately if ISeq::compile_data is available. Not sure why this state is allowed, but exception during compile (or `ISeq::load`) can make such states. Modified files: trunk/iseq.c Index: iseq.c =================================================================== --- iseq.c (revision 60914) +++ iseq.c (revision 60915) @@ -2327,6 +2327,10 @@ rb_iseq_trace_set(const rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/iseq.c#L2327 if (iseq->aux.trace_events == turnon_events) { return; } + if (iseq->flags & ISEQ_USE_COMPILE_DATA) { + /* this is building ISeq */ + return; + } else { unsigned int i; VALUE *iseq_encoded = (VALUE *)iseq->body->iseq_encoded; @@ -2336,9 +2340,6 @@ rb_iseq_trace_set(const rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/iseq.c#L2340 #else const VALUE *code = iseq->body->iseq_encoded; #endif - if (iseq->flags & ISEQ_USE_COMPILE_DATA) { - rb_bug("ISEQ_USE_COMPILE_DATA should not be enabled: %s:%d\n", RSTRING_PTR(rb_iseq_path(iseq)), FIX2INT(rb_iseq_first_lineno(iseq))); - } ((rb_iseq_t *)iseq)->aux.trace_events = turnon_events; for (i=0; i<iseq->body->iseq_size;) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/