ruby-changes:54050
From: duerst <ko1@a...>
Date: Fri, 7 Dec 2018 16:20:32 +0900 (JST)
Subject: [ruby-changes:54050] duerst:r66269 (trunk): convert check for array length to assertion and comment out
duerst 2018-12-07 16:20:26 +0900 (Fri, 07 Dec 2018) New Revision: 66269 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66269 Log: convert check for array length to assertion and comment out In regparse.c, in function node_extended_grapheme_cluster, we used a raw if() with exit(1) as a cross-check for our length calculations for the common node array. Convert this to an assertion and comment it out because it is not needed for active code. Modified files: trunk/regparse.c Index: regparse.c =================================================================== --- regparse.c (revision 66268) +++ regparse.c (revision 66269) @@ -5937,7 +5937,7 @@ node_extended_grapheme_cluster(Node** np https://github.com/ruby/ruby/blob/trunk/regparse.c#L5937 /* (Extend* ZWJ \p{Extended_Pictographic})* */ { Node **Ex_list = XP_list + 2; /* size: 4 */ - if (!(Ex_list+4 == node_common+NODE_COMMON_SIZE)) exit(1); + /* assert(Ex_list+4 == node_common+NODE_COMMON_SIZE); */ R_ERR(quantify_property_node(Ex_list+0, env, "Grapheme_Cluster_Break=Extend", '*')); /* ZWJ (ZERO WIDTH JOINER) */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/