p358-p374.patch 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020
  1. From c31e7c1e8b2895ef33204938487597e2b3acaaf7 Mon Sep 17 00:00:00 2001
  2. From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  3. Date: Fri, 2 Mar 2012 02:45:35 +0000
  4. Subject: [PATCH 01/19] merge revision(s) 25230,34866:
  5. * marshal.c (struct {dump,load}_arg): manage with dfree, instead
  6. of using local variable which may be moved by context switch.
  7. [ruby-dev:39425]
  8. * marshal.c (mark_dump_arg): mark destination string. patch by
  9. Vit Ondruch. [Bug #4339]
  10. * marshal.c (clear_dump_arg, clear_load_arg): clean up also data
  11. tables as same as symbols tables.
  12. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@34867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  13. ---
  14. ChangeLog | 14 +++++
  15. marshal.c | 145 +++++++++++++++++++++++-----------------------
  16. test/ruby/test_marshal.rb | 28 +++++++++
  17. version.h | 10 ++--
  18. 4 files changed, 120 insertions(+), 77 deletions(-)
  19. diff --git a/ChangeLog b/ChangeLog
  20. index a09237e..352a30f 100644
  21. --- a/ChangeLog
  22. +++ b/ChangeLog
  23. @@ -1,3 +1,17 @@
  24. +Fri Mar 2 11:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  25. +
  26. + * marshal.c (mark_dump_arg): mark destination string. patch by
  27. + Vit Ondruch. [Bug #4339]
  28. +
  29. + * marshal.c (clear_dump_arg, clear_load_arg): clean up also data
  30. + tables as same as symbols tables.
  31. +
  32. +Fri Mar 2 11:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  33. +
  34. + * marshal.c (struct {dump,load}_arg): manage with dfree, instead
  35. + of using local variable which may be moved by context switch.
  36. + [ruby-dev:39425]
  37. +
  38. Wed Feb 8 14:06:59 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
  39. * ext/openssl/ossl_ssl.c: Add SSL constants and allow to unset SSL
  40. diff --git a/marshal.c b/marshal.c
  41. index 35e0d60..632f6ca 100644
  42. --- a/marshal.c
  43. +++ b/marshal.c
  44. @@ -85,12 +85,10 @@
  45. static ID s_getc, s_read, s_write, s_binmode;
  46. struct dump_arg {
  47. - VALUE obj;
  48. VALUE str, dest;
  49. st_table *symbols;
  50. st_table *data;
  51. int taint;
  52. - VALUE wrapper;
  53. };
  54. struct dump_call_arg {
  55. @@ -104,20 +102,31 @@ struct dump_call_arg {
  56. struct dump_arg *arg;
  57. ID sym;
  58. {
  59. - if (!DATA_PTR(arg->wrapper)) {
  60. + if (!arg->symbols) {
  61. rb_raise(rb_eRuntimeError, "Marshal.dump reentered at %s",
  62. rb_id2name(sym));
  63. }
  64. }
  65. +static void clear_dump_arg _((struct dump_arg *arg));
  66. +
  67. static void
  68. mark_dump_arg(ptr)
  69. void *ptr;
  70. {
  71. struct dump_arg *p = ptr;
  72. - if (!ptr)
  73. + if (!p->symbols)
  74. return;
  75. rb_mark_set(p->data);
  76. + rb_gc_mark(p->str);
  77. +}
  78. +
  79. +static void
  80. +free_dump_arg(ptr)
  81. + void *ptr;
  82. +{
  83. + clear_dump_arg(ptr);
  84. + xfree(ptr);
  85. }
  86. static VALUE
  87. @@ -699,32 +708,18 @@ class2path(klass)
  88. }
  89. }
  90. -static VALUE
  91. -dump(arg)
  92. - struct dump_call_arg *arg;
  93. -{
  94. - w_object(arg->obj, arg->arg, arg->limit);
  95. - if (arg->arg->dest) {
  96. - rb_io_write(arg->arg->dest, arg->arg->str);
  97. - rb_str_resize(arg->arg->str, 0);
  98. - }
  99. - return 0;
  100. -}
  101. -
  102. -static VALUE
  103. -dump_ensure(arg)
  104. +static void
  105. +clear_dump_arg(arg)
  106. struct dump_arg *arg;
  107. {
  108. - if (!DATA_PTR(arg->wrapper)) return 0;
  109. + if (!arg->symbols) return;
  110. st_free_table(arg->symbols);
  111. + arg->symbols = 0;
  112. st_free_table(arg->data);
  113. - DATA_PTR(arg->wrapper) = 0;
  114. - arg->wrapper = 0;
  115. + arg->data = 0;
  116. if (arg->taint) {
  117. OBJ_TAINT(arg->str);
  118. }
  119. -
  120. - return 0;
  121. }
  122. /*
  123. @@ -760,8 +755,8 @@ class2path(klass)
  124. {
  125. VALUE obj, port, a1, a2;
  126. int limit = -1;
  127. - struct dump_arg arg;
  128. - struct dump_call_arg c_arg;
  129. + struct dump_arg *arg;
  130. + VALUE wrapper;
  131. port = Qnil;
  132. rb_scan_args(argc, argv, "12", &obj, &a1, &a2);
  133. @@ -775,37 +770,40 @@ class2path(klass)
  134. else if (NIL_P(a1)) goto type_error;
  135. else port = a1;
  136. }
  137. - arg.dest = 0;
  138. - arg.symbols = st_init_numtable();
  139. - arg.data = st_init_numtable();
  140. - arg.taint = Qfalse;
  141. - arg.str = rb_str_buf_new(0);
  142. - RBASIC(arg.str)->klass = 0;
  143. - arg.wrapper = Data_Wrap_Struct(rb_cData, mark_dump_arg, 0, &arg);
  144. + wrapper = Data_Make_Struct(rb_cData, struct dump_arg, mark_dump_arg, free_dump_arg, arg);
  145. + arg->dest = 0;
  146. + arg->symbols = st_init_numtable();
  147. + arg->data = st_init_numtable();
  148. + arg->taint = Qfalse;
  149. + arg->str = rb_str_buf_new(0);
  150. + RBASIC(arg->str)->klass = 0;
  151. if (!NIL_P(port)) {
  152. if (!rb_respond_to(port, s_write)) {
  153. type_error:
  154. rb_raise(rb_eTypeError, "instance of IO needed");
  155. }
  156. - arg.dest = port;
  157. + arg->dest = port;
  158. if (rb_respond_to(port, s_binmode)) {
  159. rb_funcall2(port, s_binmode, 0, 0);
  160. - check_dump_arg(&arg, s_binmode);
  161. + check_dump_arg(arg, s_binmode);
  162. }
  163. }
  164. else {
  165. - port = arg.str;
  166. + port = arg->str;
  167. }
  168. - c_arg.obj = obj;
  169. - c_arg.arg = &arg;
  170. - c_arg.limit = limit;
  171. + w_byte(MARSHAL_MAJOR, arg);
  172. + w_byte(MARSHAL_MINOR, arg);
  173. - w_byte(MARSHAL_MAJOR, &arg);
  174. - w_byte(MARSHAL_MINOR, &arg);
  175. + w_object(obj, arg, limit);
  176. + if (arg->dest) {
  177. + rb_io_write(arg->dest, arg->str);
  178. + rb_str_resize(arg->str, 0);
  179. + }
  180. - rb_ensure(dump, (VALUE)&c_arg, dump_ensure, (VALUE)&arg);
  181. - RBASIC(arg.str)->klass = rb_cString;
  182. + RBASIC(arg->str)->klass = rb_cString;
  183. + clear_dump_arg(arg);
  184. + RB_GC_GUARD(wrapper);
  185. return port;
  186. }
  187. @@ -817,7 +815,6 @@ struct load_arg {
  188. st_table *data;
  189. VALUE proc;
  190. int taint;
  191. - VALUE wrapper;
  192. };
  193. static void
  194. @@ -825,22 +822,31 @@ struct load_arg {
  195. struct load_arg *arg;
  196. ID sym;
  197. {
  198. - if (!DATA_PTR(arg->wrapper)) {
  199. + if (!arg->symbols) {
  200. rb_raise(rb_eRuntimeError, "Marshal.load reentered at %s",
  201. rb_id2name(sym));
  202. }
  203. }
  204. +static void clear_load_arg _((struct load_arg *arg));
  205. +
  206. static void
  207. mark_load_arg(ptr)
  208. void *ptr;
  209. {
  210. struct load_arg *p = ptr;
  211. - if (!ptr)
  212. + if (!p->symbols)
  213. return;
  214. rb_mark_tbl(p->data);
  215. }
  216. +static void
  217. +free_load_arg(void *ptr)
  218. +{
  219. + clear_load_arg(ptr);
  220. + xfree(ptr);
  221. +}
  222. +
  223. static VALUE r_object _((struct load_arg *arg));
  224. static int
  225. @@ -1415,23 +1421,15 @@ struct load_arg {
  226. return r_object0(arg, arg->proc, 0, Qnil);
  227. }
  228. -static VALUE
  229. -load(arg)
  230. - struct load_arg *arg;
  231. -{
  232. - return r_object(arg);
  233. -}
  234. -
  235. -static VALUE
  236. -load_ensure(arg)
  237. +static void
  238. +clear_load_arg(arg)
  239. struct load_arg *arg;
  240. {
  241. - if (!DATA_PTR(arg->wrapper)) return 0;
  242. + if (!arg->symbols) return;
  243. st_free_table(arg->symbols);
  244. + arg->symbols = 0;
  245. st_free_table(arg->data);
  246. - DATA_PTR(arg->wrapper) = 0;
  247. - arg->wrapper = 0;
  248. - return 0;
  249. + arg->data = 0;
  250. }
  251. /*
  252. @@ -1452,8 +1450,8 @@ struct load_arg {
  253. {
  254. VALUE port, proc;
  255. int major, minor, taint = Qfalse;
  256. - VALUE v;
  257. - struct load_arg arg;
  258. + VALUE v, wrapper;
  259. + struct load_arg *arg;
  260. rb_scan_args(argc, argv, "11", &port, &proc);
  261. v = rb_check_string_type(port);
  262. @@ -1470,17 +1468,18 @@ struct load_arg {
  263. else {
  264. rb_raise(rb_eTypeError, "instance of IO needed");
  265. }
  266. - arg.src = port;
  267. - arg.offset = 0;
  268. - arg.symbols = st_init_numtable();
  269. - arg.data = st_init_numtable();
  270. - arg.proc = 0;
  271. - arg.wrapper = Data_Wrap_Struct(rb_cData, mark_load_arg, 0, &arg);
  272. - arg.taint = taint;
  273. -
  274. - major = r_byte(&arg);
  275. - minor = r_byte(&arg);
  276. + wrapper = Data_Make_Struct(rb_cData, struct load_arg, mark_load_arg, free_load_arg, arg);
  277. + arg->src = port;
  278. + arg->offset = 0;
  279. + arg->symbols = st_init_numtable();
  280. + arg->data = st_init_numtable();
  281. + arg->proc = 0;
  282. + arg->taint = taint;
  283. +
  284. + major = r_byte(arg);
  285. + minor = r_byte(arg);
  286. if (major != MARSHAL_MAJOR || minor > MARSHAL_MINOR) {
  287. + clear_load_arg(arg);
  288. rb_raise(rb_eTypeError, "incompatible marshal file format (can't be read)\n\
  289. \tformat version %d.%d required; %d.%d given",
  290. MARSHAL_MAJOR, MARSHAL_MINOR, major, minor);
  291. @@ -1491,8 +1490,10 @@ struct load_arg {
  292. MARSHAL_MAJOR, MARSHAL_MINOR, major, minor);
  293. }
  294. - if (!NIL_P(proc)) arg.proc = proc;
  295. - v = rb_ensure(load, (VALUE)&arg, load_ensure, (VALUE)&arg);
  296. + if (!NIL_P(proc)) arg->proc = proc;
  297. + v = r_object(arg);
  298. + clear_load_arg(arg);
  299. + RB_GC_GUARD(wrapper);
  300. return v;
  301. }
  302. diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
  303. index 5ae521e..d40c9da 100644
  304. --- a/test/ruby/test_marshal.rb
  305. +++ b/test/ruby/test_marshal.rb
  306. @@ -72,6 +72,34 @@ def test_too_long_string
  307. assert_equal("marshal data too short", e.message)
  308. end
  309. + class DumpTest
  310. + def marshal_dump
  311. + loop { Thread.pass }
  312. + end
  313. + end
  314. +
  315. + class LoadTest
  316. + def marshal_dump
  317. + nil
  318. + end
  319. + def marshal_load(obj)
  320. + loop { Thread.pass }
  321. + end
  322. + end
  323. +
  324. + def test_context_switch
  325. + o = DumpTest.new
  326. + Thread.new { Marshal.dump(o) }
  327. + GC.start
  328. + assert(true, '[ruby-dev:39425]')
  329. +
  330. + o = LoadTest.new
  331. + m = Marshal.dump(o)
  332. + Thread.new { Marshal.load(m) }
  333. + GC.start
  334. + assert(true, '[ruby-dev:39425]')
  335. + end
  336. +
  337. def test_taint
  338. x = Object.new
  339. x.taint
  340. diff --git a/version.h b/version.h
  341. index d6f16f5..1f2a143 100644
  342. --- a/version.h
  343. +++ b/version.h
  344. @@ -1,15 +1,15 @@
  345. #define RUBY_VERSION "1.8.7"
  346. -#define RUBY_RELEASE_DATE "2012-02-08"
  347. +#define RUBY_RELEASE_DATE "2012-03-02"
  348. #define RUBY_VERSION_CODE 187
  349. -#define RUBY_RELEASE_CODE 20120208
  350. -#define RUBY_PATCHLEVEL 358
  351. +#define RUBY_RELEASE_CODE 20120302
  352. +#define RUBY_PATCHLEVEL 359
  353. #define RUBY_VERSION_MAJOR 1
  354. #define RUBY_VERSION_MINOR 8
  355. #define RUBY_VERSION_TEENY 7
  356. #define RUBY_RELEASE_YEAR 2012
  357. -#define RUBY_RELEASE_MONTH 2
  358. -#define RUBY_RELEASE_DAY 8
  359. +#define RUBY_RELEASE_MONTH 3
  360. +#define RUBY_RELEASE_DAY 2
  361. #ifdef RUBY_EXTERN
  362. RUBY_EXTERN const char ruby_version[];
  363. --
  364. 1.8.5.1
  365. From acc55c25c587fef5c7327c5912f3aa50a969ec34 Mon Sep 17 00:00:00 2001
  366. From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  367. Date: Tue, 6 Mar 2012 03:06:11 +0000
  368. Subject: [PATCH 02/19] merge revision(s) 34919:
  369. * lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
  370. YAML serialization problem for Exception.
  371. Exception#initialize doesn't use visible instance variable for
  372. the exception message, so call the method with the message.
  373. patched by Jingwen Owen Ou <jingweno AT gmail.com>.
  374. http://github.com/ruby/ruby/pull/41
  375. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@34920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  376. ---
  377. ChangeLog | 9 ++++++++
  378. lib/yaml/rubytypes.rb | 3 ++-
  379. test/yaml/test_exception.rb | 52 +++++++++++++++++++++++++++++++++++++++++++++
  380. version.h | 8 +++----
  381. 4 files changed, 67 insertions(+), 5 deletions(-)
  382. create mode 100644 test/yaml/test_exception.rb
  383. diff --git a/ChangeLog b/ChangeLog
  384. index 352a30f..886be66 100644
  385. --- a/ChangeLog
  386. +++ b/ChangeLog
  387. @@ -1,3 +1,12 @@
  388. +Tue Mar 6 12:05:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  389. +
  390. + * lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
  391. + YAML serialization problem for Exception.
  392. + Exception#initialize doesn't use visible instance variable for
  393. + the exception message, so call the method with the message.
  394. + patched by Jingwen Owen Ou <jingweno AT gmail.com>.
  395. + http://github.com/ruby/ruby/pull/41
  396. +
  397. Fri Mar 2 11:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  398. * marshal.c (mark_dump_arg): mark destination string. patch by
  399. diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
  400. index 35b7191..55d59fa 100644
  401. --- a/lib/yaml/rubytypes.rb
  402. +++ b/lib/yaml/rubytypes.rb
  403. @@ -117,7 +117,8 @@ def to_yaml( opts = {} )
  404. class Exception
  405. yaml_as "tag:ruby.yaml.org,2002:exception"
  406. def Exception.yaml_new( klass, tag, val )
  407. - o = YAML.object_maker( klass, { 'mesg' => val.delete( 'message' ) } )
  408. + o = klass.allocate
  409. + Exception.instance_method(:initialize).bind(o).call(val.delete('message'))
  410. val.each_pair do |k,v|
  411. o.instance_variable_set("@#{k}", v)
  412. end
  413. diff --git a/test/yaml/test_exception.rb b/test/yaml/test_exception.rb
  414. new file mode 100644
  415. index 0000000..1dc3044
  416. --- /dev/null
  417. +++ b/test/yaml/test_exception.rb
  418. @@ -0,0 +1,52 @@
  419. +require 'test/unit'
  420. +require 'yaml'
  421. +
  422. +module Syck
  423. + class TestException < Test::Unit::TestCase
  424. + class Wups < Exception
  425. + attr_reader :foo, :bar
  426. + def initialize *args
  427. + super
  428. + @foo = 1
  429. + @bar = 2
  430. + end
  431. +
  432. + def ==(other)
  433. + self.class == other.class and
  434. + self.message == other.message and
  435. + self.backtrace == other.backtrace
  436. + end
  437. + end
  438. +
  439. + def setup
  440. + @wups = Wups.new('test_message')
  441. + end
  442. +
  443. + def test_to_yaml
  444. + w = YAML.load(@wups.to_yaml)
  445. + assert_equal @wups, w
  446. + assert_equal 1, w.foo
  447. + assert_equal 2, w.bar
  448. + end
  449. +
  450. + def test_dump
  451. + w = YAML.load(@wups.to_yaml)
  452. + assert_equal @wups, w
  453. + assert_equal 1, w.foo
  454. + assert_equal 2, w.bar
  455. + end
  456. +
  457. + def test_to_yaml_properties
  458. + class << @wups
  459. + def to_yaml_properties
  460. + [:@foo]
  461. + end
  462. + end
  463. +
  464. + w = YAML.load(YAML.dump(@wups))
  465. + assert_equal @wups, w
  466. + assert_equal 1, w.foo
  467. + assert_nil w.bar
  468. + end
  469. + end
  470. +end
  471. diff --git a/version.h b/version.h
  472. index 1f2a143..13e41e8 100644
  473. --- a/version.h
  474. +++ b/version.h
  475. @@ -1,15 +1,15 @@
  476. #define RUBY_VERSION "1.8.7"
  477. -#define RUBY_RELEASE_DATE "2012-03-02"
  478. +#define RUBY_RELEASE_DATE "2012-03-06"
  479. #define RUBY_VERSION_CODE 187
  480. -#define RUBY_RELEASE_CODE 20120302
  481. -#define RUBY_PATCHLEVEL 359
  482. +#define RUBY_RELEASE_CODE 20120306
  483. +#define RUBY_PATCHLEVEL 360
  484. #define RUBY_VERSION_MAJOR 1
  485. #define RUBY_VERSION_MINOR 8
  486. #define RUBY_VERSION_TEENY 7
  487. #define RUBY_RELEASE_YEAR 2012
  488. #define RUBY_RELEASE_MONTH 3
  489. -#define RUBY_RELEASE_DAY 2
  490. +#define RUBY_RELEASE_DAY 6
  491. #ifdef RUBY_EXTERN
  492. RUBY_EXTERN const char ruby_version[];
  493. --
  494. 1.8.5.1
  495. From 698d21a276f862da823c7a6536f9c15afe602e19 Mon Sep 17 00:00:00 2001
  496. From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  497. Date: Sat, 14 Apr 2012 09:52:10 +0000
  498. Subject: [PATCH 03/19] merge revision(s) 35325:
  499. * bignum.c (rb_big2str0): prevent working clone from
  500. GC. [exerb-dev:0578]. patched by MURASE Masamitsu
  501. <masamitsu.murase AT gmail.com> at [exerb-dev:0580]
  502. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  503. ---
  504. ChangeLog | 6 ++++++
  505. bignum.c | 3 ++-
  506. version.h | 10 +++++-----
  507. 3 files changed, 13 insertions(+), 6 deletions(-)
  508. diff --git a/ChangeLog b/ChangeLog
  509. index 886be66..fae1bb1 100644
  510. --- a/ChangeLog
  511. +++ b/ChangeLog
  512. @@ -1,3 +1,9 @@
  513. +Sat Apr 14 18:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  514. +
  515. + * bignum.c (rb_big2str0): prevent working clone from
  516. + GC. [exerb-dev:0578]. patched by MURASE Masamitsu
  517. + <masamitsu.murase AT gmail.com> at [exerb-dev:0580]
  518. +
  519. Tue Mar 6 12:05:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  520. * lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
  521. diff --git a/bignum.c b/bignum.c
  522. index 0c5ae3e..77697ae 100644
  523. --- a/bignum.c
  524. +++ b/bignum.c
  525. @@ -772,7 +772,7 @@
  526. int base;
  527. int trim;
  528. {
  529. - volatile VALUE t;
  530. + VALUE t;
  531. BDIGIT *ds;
  532. long i, j, hbase;
  533. VALUE ss;
  534. @@ -847,6 +847,7 @@
  535. if (trim && i == 0 && num == 0) break;
  536. }
  537. }
  538. + RB_GC_GUARD(t);
  539. if (trim) {while (s[j] == '0') j++;}
  540. i = RSTRING(ss)->len - j;
  541. if (RBIGNUM(x)->sign) {
  542. diff --git a/version.h b/version.h
  543. index 13e41e8..a2b4487 100644
  544. --- a/version.h
  545. +++ b/version.h
  546. @@ -1,15 +1,15 @@
  547. #define RUBY_VERSION "1.8.7"
  548. -#define RUBY_RELEASE_DATE "2012-03-06"
  549. +#define RUBY_RELEASE_DATE "2012-04-14"
  550. #define RUBY_VERSION_CODE 187
  551. -#define RUBY_RELEASE_CODE 20120306
  552. -#define RUBY_PATCHLEVEL 360
  553. +#define RUBY_RELEASE_CODE 20120414
  554. +#define RUBY_PATCHLEVEL 361
  555. #define RUBY_VERSION_MAJOR 1
  556. #define RUBY_VERSION_MINOR 8
  557. #define RUBY_VERSION_TEENY 7
  558. #define RUBY_RELEASE_YEAR 2012
  559. -#define RUBY_RELEASE_MONTH 3
  560. -#define RUBY_RELEASE_DAY 6
  561. +#define RUBY_RELEASE_MONTH 4
  562. +#define RUBY_RELEASE_DAY 14
  563. #ifdef RUBY_EXTERN
  564. RUBY_EXTERN const char ruby_version[];
  565. --
  566. 1.8.5.1
  567. From a4e76099bf44ae7d75bd24c3c8233d710e590fac Mon Sep 17 00:00:00 2001
  568. From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  569. Date: Fri, 11 May 2012 05:09:58 +0000
  570. Subject: [PATCH 04/19] * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE
  571. from GC, must not cast it to unsigned long, which may be shorter than
  572. VALUE, and the result can be mere garbage.
  573. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  574. ---
  575. ChangeLog | 6 ++++++
  576. ext/bigdecimal/bigdecimal.c | 2 +-
  577. version.h | 10 +++++-----
  578. 3 files changed, 12 insertions(+), 6 deletions(-)
  579. diff --git a/ChangeLog b/ChangeLog
  580. index fae1bb1..9201d3e 100644
  581. --- a/ChangeLog
  582. +++ b/ChangeLog
  583. @@ -1,3 +1,9 @@
  584. +Fri May 11 14:09:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  585. +
  586. + * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
  587. + must not cast it to unsigned long, which may be shorter than
  588. + VALUE, and the result can be mere garbage.
  589. +
  590. Sat Apr 14 18:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  591. * bignum.c (rb_big2str0): prevent working clone from
  592. diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
  593. index 7846c0d..16be520 100644
  594. --- a/ext/bigdecimal/bigdecimal.c
  595. +++ b/ext/bigdecimal/bigdecimal.c
  596. @@ -32,7 +32,7 @@
  597. /* MACRO's to guard objects from GC by keeping them in stack */
  598. #define ENTER(n) volatile VALUE vStack[n];int iStack=0
  599. -#define PUSH(x) vStack[iStack++] = (unsigned long)(x);
  600. +#define PUSH(x) vStack[iStack++] = (VALUE)(x);
  601. #define SAVE(p) PUSH(p->obj);
  602. #define GUARD_OBJ(p,y) {p=y;SAVE(p);}
  603. diff --git a/version.h b/version.h
  604. index a2b4487..9dcae40 100644
  605. --- a/version.h
  606. +++ b/version.h
  607. @@ -1,15 +1,15 @@
  608. #define RUBY_VERSION "1.8.7"
  609. -#define RUBY_RELEASE_DATE "2012-04-14"
  610. +#define RUBY_RELEASE_DATE "2012-05-11"
  611. #define RUBY_VERSION_CODE 187
  612. -#define RUBY_RELEASE_CODE 20120414
  613. -#define RUBY_PATCHLEVEL 361
  614. +#define RUBY_RELEASE_CODE 20120511
  615. +#define RUBY_PATCHLEVEL 362
  616. #define RUBY_VERSION_MAJOR 1
  617. #define RUBY_VERSION_MINOR 8
  618. #define RUBY_VERSION_TEENY 7
  619. #define RUBY_RELEASE_YEAR 2012
  620. -#define RUBY_RELEASE_MONTH 4
  621. -#define RUBY_RELEASE_DAY 14
  622. +#define RUBY_RELEASE_MONTH 5
  623. +#define RUBY_RELEASE_DAY 11
  624. #ifdef RUBY_EXTERN
  625. RUBY_EXTERN const char ruby_version[];
  626. --
  627. 1.8.5.1
  628. From b0901e0f63ed056c9c95273052a029930cad87af Mon Sep 17 00:00:00 2001
  629. From: knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  630. Date: Mon, 21 May 2012 07:35:21 +0000
  631. Subject: [PATCH 05/19] * ext/syslog/syslog.c (mSyslog_inspect): Make sure self
  632. is a module before calling rb_class2name().
  633. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  634. ---
  635. ChangeLog | 5 +++++
  636. ext/syslog/syslog.c | 2 ++
  637. 2 files changed, 7 insertions(+)
  638. diff --git a/ChangeLog b/ChangeLog
  639. index 9201d3e..3c477b4 100644
  640. --- a/ChangeLog
  641. +++ b/ChangeLog
  642. @@ -1,3 +1,8 @@
  643. +Mon May 21 16:29:47 2012 Akinori MUSHA <knu@iDaemons.org>
  644. +
  645. + * ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
  646. + module before calling rb_class2name().
  647. +
  648. Fri May 11 14:09:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  649. * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
  650. diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
  651. index ecc4931..1372cb7 100644
  652. --- a/ext/syslog/syslog.c
  653. +++ b/ext/syslog/syslog.c
  654. @@ -168,6 +168,8 @@ static VALUE mSyslog_inspect(VALUE self)
  655. {
  656. char buf[1024];
  657. + Check_Type(self, T_MODULE);
  658. +
  659. if (syslog_opened) {
  660. snprintf(buf, sizeof(buf),
  661. "<#%s: opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
  662. --
  663. 1.8.5.1
  664. From c869f69c3543552c0ffa27628d587bae460b6213 Mon Sep 17 00:00:00 2001
  665. From: svn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  666. Date: Mon, 21 May 2012 07:35:26 +0000
  667. Subject: [PATCH 06/19] * 2012-05-21
  668. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  669. ---
  670. version.h | 6 +++---
  671. 1 file changed, 3 insertions(+), 3 deletions(-)
  672. diff --git a/version.h b/version.h
  673. index 9dcae40..927ae53 100644
  674. --- a/version.h
  675. +++ b/version.h
  676. @@ -1,7 +1,7 @@
  677. #define RUBY_VERSION "1.8.7"
  678. -#define RUBY_RELEASE_DATE "2012-05-11"
  679. +#define RUBY_RELEASE_DATE "2012-05-21"
  680. #define RUBY_VERSION_CODE 187
  681. -#define RUBY_RELEASE_CODE 20120511
  682. +#define RUBY_RELEASE_CODE 20120521
  683. #define RUBY_PATCHLEVEL 362
  684. #define RUBY_VERSION_MAJOR 1
  685. @@ -9,7 +9,7 @@
  686. #define RUBY_VERSION_TEENY 7
  687. #define RUBY_RELEASE_YEAR 2012
  688. #define RUBY_RELEASE_MONTH 5
  689. -#define RUBY_RELEASE_DAY 11
  690. +#define RUBY_RELEASE_DAY 21
  691. #ifdef RUBY_EXTERN
  692. RUBY_EXTERN const char ruby_version[];
  693. --
  694. 1.8.5.1
  695. From 69883b3ee6502cc210e598fd440b65e20629cd9c Mon Sep 17 00:00:00 2001
  696. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  697. Date: Wed, 6 Jun 2012 05:20:08 +0000
  698. Subject: [PATCH 07/19] merge revision(s) 33611: *
  699. lib/webrick/utils.rb: fix fcntl call. * lib/drb/unix.rb: ditto.
  700. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  701. ---
  702. ChangeLog | 6 ++++++
  703. lib/drb/unix.rb | 2 +-
  704. lib/webrick/utils.rb | 2 +-
  705. version.h | 10 +++++-----
  706. 4 files changed, 13 insertions(+), 7 deletions(-)
  707. diff --git a/ChangeLog b/ChangeLog
  708. index 3c477b4..dd5808a 100644
  709. --- a/ChangeLog
  710. +++ b/ChangeLog
  711. @@ -1,3 +1,9 @@
  712. +Wed Jun 6 14:06:02 2012 Tanaka Akira <akr@fsij.org>
  713. +
  714. + * lib/webrick/utils.rb: fix fcntl call.
  715. +
  716. + * lib/drb/unix.rb: ditto.
  717. +
  718. Mon May 21 16:29:47 2012 Akinori MUSHA <knu@iDaemons.org>
  719. * ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
  720. diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
  721. index 57feed8..90ca292 100644
  722. --- a/lib/drb/unix.rb
  723. +++ b/lib/drb/unix.rb
  724. @@ -100,7 +100,7 @@ def accept
  725. end
  726. def set_sockopt(soc)
  727. - soc.fcntl(Fcntl::F_SETFL, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
  728. + soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
  729. end
  730. end
  731. diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
  732. index cf9da6f..1c29ef5 100644
  733. --- a/lib/webrick/utils.rb
  734. +++ b/lib/webrick/utils.rb
  735. @@ -29,7 +29,7 @@ def set_non_blocking(io)
  736. def set_close_on_exec(io)
  737. if defined?(Fcntl::FD_CLOEXEC)
  738. - io.fcntl(Fcntl::FD_CLOEXEC, 1)
  739. + io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
  740. end
  741. end
  742. module_function :set_close_on_exec
  743. diff --git a/version.h b/version.h
  744. index 927ae53..d084c57 100644
  745. --- a/version.h
  746. +++ b/version.h
  747. @@ -1,15 +1,15 @@
  748. #define RUBY_VERSION "1.8.7"
  749. -#define RUBY_RELEASE_DATE "2012-05-21"
  750. +#define RUBY_RELEASE_DATE "2012-06-06"
  751. #define RUBY_VERSION_CODE 187
  752. -#define RUBY_RELEASE_CODE 20120521
  753. -#define RUBY_PATCHLEVEL 362
  754. +#define RUBY_RELEASE_CODE 20120606
  755. +#define RUBY_PATCHLEVEL 363
  756. #define RUBY_VERSION_MAJOR 1
  757. #define RUBY_VERSION_MINOR 8
  758. #define RUBY_VERSION_TEENY 7
  759. #define RUBY_RELEASE_YEAR 2012
  760. -#define RUBY_RELEASE_MONTH 5
  761. -#define RUBY_RELEASE_DAY 21
  762. +#define RUBY_RELEASE_MONTH 6
  763. +#define RUBY_RELEASE_DAY 6
  764. #ifdef RUBY_EXTERN
  765. RUBY_EXTERN const char ruby_version[];
  766. --
  767. 1.8.5.1
  768. From 996e9cf4e9c78c4bf8fdbf937f3984e0b2eb6e40 Mon Sep 17 00:00:00 2001
  769. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  770. Date: Wed, 6 Jun 2012 05:34:55 +0000
  771. Subject: [PATCH 08/19] @nobu you must run make test-all _before_ you check in.
  772. reverting revision r34920 because it fails.
  773. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  774. ---
  775. lib/yaml/rubytypes.rb | 3 +--
  776. test/yaml/test_exception.rb | 52 ---------------------------------------------
  777. version.h | 2 +-
  778. 3 files changed, 2 insertions(+), 55 deletions(-)
  779. delete mode 100644 test/yaml/test_exception.rb
  780. diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
  781. index 55d59fa..35b7191 100644
  782. --- a/lib/yaml/rubytypes.rb
  783. +++ b/lib/yaml/rubytypes.rb
  784. @@ -117,8 +117,7 @@ def to_yaml( opts = {} )
  785. class Exception
  786. yaml_as "tag:ruby.yaml.org,2002:exception"
  787. def Exception.yaml_new( klass, tag, val )
  788. - o = klass.allocate
  789. - Exception.instance_method(:initialize).bind(o).call(val.delete('message'))
  790. + o = YAML.object_maker( klass, { 'mesg' => val.delete( 'message' ) } )
  791. val.each_pair do |k,v|
  792. o.instance_variable_set("@#{k}", v)
  793. end
  794. diff --git a/test/yaml/test_exception.rb b/test/yaml/test_exception.rb
  795. deleted file mode 100644
  796. index 1dc3044..0000000
  797. --- a/test/yaml/test_exception.rb
  798. +++ /dev/null
  799. @@ -1,52 +0,0 @@
  800. -require 'test/unit'
  801. -require 'yaml'
  802. -
  803. -module Syck
  804. - class TestException < Test::Unit::TestCase
  805. - class Wups < Exception
  806. - attr_reader :foo, :bar
  807. - def initialize *args
  808. - super
  809. - @foo = 1
  810. - @bar = 2
  811. - end
  812. -
  813. - def ==(other)
  814. - self.class == other.class and
  815. - self.message == other.message and
  816. - self.backtrace == other.backtrace
  817. - end
  818. - end
  819. -
  820. - def setup
  821. - @wups = Wups.new('test_message')
  822. - end
  823. -
  824. - def test_to_yaml
  825. - w = YAML.load(@wups.to_yaml)
  826. - assert_equal @wups, w
  827. - assert_equal 1, w.foo
  828. - assert_equal 2, w.bar
  829. - end
  830. -
  831. - def test_dump
  832. - w = YAML.load(@wups.to_yaml)
  833. - assert_equal @wups, w
  834. - assert_equal 1, w.foo
  835. - assert_equal 2, w.bar
  836. - end
  837. -
  838. - def test_to_yaml_properties
  839. - class << @wups
  840. - def to_yaml_properties
  841. - [:@foo]
  842. - end
  843. - end
  844. -
  845. - w = YAML.load(YAML.dump(@wups))
  846. - assert_equal @wups, w
  847. - assert_equal 1, w.foo
  848. - assert_nil w.bar
  849. - end
  850. - end
  851. -end
  852. diff --git a/version.h b/version.h
  853. index d084c57..3b58c4e 100644
  854. --- a/version.h
  855. +++ b/version.h
  856. @@ -2,7 +2,7 @@
  857. #define RUBY_RELEASE_DATE "2012-06-06"
  858. #define RUBY_VERSION_CODE 187
  859. #define RUBY_RELEASE_CODE 20120606
  860. -#define RUBY_PATCHLEVEL 363
  861. +#define RUBY_PATCHLEVEL 364
  862. #define RUBY_VERSION_MAJOR 1
  863. #define RUBY_VERSION_MINOR 8
  864. --
  865. 1.8.5.1
  866. From 1acfb03370704aee624b7a1e5ccf4776f40f2895 Mon Sep 17 00:00:00 2001
  867. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  868. Date: Wed, 6 Jun 2012 05:47:45 +0000
  869. Subject: [PATCH 09/19] merge revision(s) 28324: * bignum.c
  870. (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f): A negative Bignum
  871. out of Float range should be converted to -Infinity. [ruby-core:30492]
  872. [Bug #3362]
  873. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  874. ---
  875. ChangeLog | 15 ++++++---------
  876. bignum.c | 5 ++++-
  877. test/ruby/test_bignum.rb | 6 ++++++
  878. version.h | 2 +-
  879. 4 files changed, 17 insertions(+), 11 deletions(-)
  880. diff --git a/ChangeLog b/ChangeLog
  881. index dd5808a..69c7ced 100644
  882. --- a/ChangeLog
  883. +++ b/ChangeLog
  884. @@ -1,3 +1,9 @@
  885. +Wed Jun 6 14:44:13 2012 Kenta Murata <mrkn@mrkn.jp>
  886. +
  887. + * bignum.c (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f):
  888. + A negative Bignum out of Float range should be converted to -Infinity.
  889. + [ruby-core:30492] [Bug #3362]
  890. +
  891. Wed Jun 6 14:06:02 2012 Tanaka Akira <akr@fsij.org>
  892. * lib/webrick/utils.rb: fix fcntl call.
  893. @@ -21,15 +27,6 @@ Sat Apr 14 18:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  894. GC. [exerb-dev:0578]. patched by MURASE Masamitsu
  895. <masamitsu.murase AT gmail.com> at [exerb-dev:0580]
  896. -Tue Mar 6 12:05:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  897. -
  898. - * lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
  899. - YAML serialization problem for Exception.
  900. - Exception#initialize doesn't use visible instance variable for
  901. - the exception message, so call the method with the message.
  902. - patched by Jingwen Owen Ou <jingweno AT gmail.com>.
  903. - http://github.com/ruby/ruby/pull/41
  904. -
  905. Fri Mar 2 11:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  906. * marshal.c (mark_dump_arg): mark destination string. patch by
  907. diff --git a/bignum.c b/bignum.c
  908. index 77697ae..6c0bf65 100644
  909. --- a/bignum.c
  910. +++ b/bignum.c
  911. @@ -1069,7 +1069,10 @@
  912. if (isinf(d)) {
  913. rb_warn("Bignum out of Float range");
  914. - d = HUGE_VAL;
  915. + if (d < 0.0)
  916. + d = -HUGE_VAL;
  917. + else
  918. + d = HUGE_VAL;
  919. }
  920. return d;
  921. }
  922. diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
  923. index 99c5952..a0405ca 100644
  924. --- a/test/ruby/test_bignum.rb
  925. +++ b/test/ruby/test_bignum.rb
  926. @@ -103,4 +103,10 @@ def test_too_big_to_s
  927. e = assert_raise(RangeError) {(1 << big).to_s}
  928. assert_match(/too big to convert/, e.message)
  929. end
  930. +
  931. + def test_to_f
  932. + inf = 1 / 0.0
  933. + assert_equal(inf, (1 << 65536).to_f)
  934. + assert_equal(-inf, (-1 << 65536).to_f) # [ruby-core:30492] [Bug #3362]
  935. + end
  936. end
  937. diff --git a/version.h b/version.h
  938. index 3b58c4e..3d64d07 100644
  939. --- a/version.h
  940. +++ b/version.h
  941. @@ -2,7 +2,7 @@
  942. #define RUBY_RELEASE_DATE "2012-06-06"
  943. #define RUBY_VERSION_CODE 187
  944. #define RUBY_RELEASE_CODE 20120606
  945. -#define RUBY_PATCHLEVEL 364
  946. +#define RUBY_PATCHLEVEL 365
  947. #define RUBY_VERSION_MAJOR 1
  948. #define RUBY_VERSION_MINOR 8
  949. --
  950. 1.8.5.1
  951. From d18b653719687756c82c7c800dee5e91b388fefd Mon Sep 17 00:00:00 2001
  952. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  953. Date: Wed, 6 Jun 2012 06:16:25 +0000
  954. Subject: [PATCH 10/19] merge revision(s) 23432: * eval.c
  955. (rb_thread_join), ext/thread/thread.c (wake_one): adjusts targets of
  956. rest waiting threads to join. [ruby-core:23457]
  957. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  958. ---
  959. ChangeLog | 5 ++++
  960. eval.c | 10 ++++++++
  961. ext/thread/thread.c | 26 +++++++++++++++++--
  962. test/thread/test_thread.rb | 63 ++++++++++++++++++++++++++++++++++++++++++++++
  963. version.h | 2 +-
  964. 5 files changed, 103 insertions(+), 3 deletions(-)
  965. diff --git a/ChangeLog b/ChangeLog
  966. index 69c7ced..8956096 100644
  967. --- a/ChangeLog
  968. +++ b/ChangeLog
  969. @@ -1,3 +1,8 @@
  970. +Wed Jun 6 15:09:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  971. +
  972. + * eval.c (rb_thread_join), ext/thread/thread.c (wake_one): adjusts
  973. + targets of rest waiting threads to join. [ruby-core:23457]
  974. +
  975. Wed Jun 6 14:44:13 2012 Kenta Murata <mrkn@mrkn.jp>
  976. * bignum.c (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f):
  977. diff --git a/test/thread/test_thread.rb b/test/thread/test_thread.rb
  978. index 699f4fe..e3246d1 100644
  979. --- a/test/thread/test_thread.rb
  980. +++ b/test/thread/test_thread.rb
  981. @@ -86,5 +86,68 @@ def test_queue_rescue
  982. assert_nothing_raised("[ruby-dev:37545]") {assert_equal(1, queue.pop)}
  983. assert(queue.empty?)
  984. end
  985. +
  986. + # This test checks that a thread in Mutex#lock which is raised is
  987. + # completely removed from the wait_list of the mutex
  988. + def test_mutex_exception_handling
  989. + m = Mutex.new
  990. + m.lock
  991. +
  992. + sleeping = false
  993. + t = Thread.new do
  994. + begin
  995. + m.lock
  996. + rescue
  997. + end
  998. +
  999. + sleeping = true
  1000. + # Keep that thread alive: if the thread returns, the test method
  1001. + # won't be able to check that +m+ has not been taken (dead mutex
  1002. + # owners are ignored)
  1003. + sleep
  1004. + end
  1005. +
  1006. + # Wait for t to wait for the mutex and raise it
  1007. + while true
  1008. + sleep 0.1
  1009. + break if t.stop?
  1010. + end
  1011. + t.raise ArgumentError
  1012. + assert(t.alive? || sleeping)
  1013. +
  1014. + # Wait for +t+ to reach the sleep
  1015. + while true
  1016. + sleep 0.1
  1017. + break if t.stop?
  1018. + end
  1019. +
  1020. + # Now unlock. The mutex should be free, so Mutex#unlock should return nil
  1021. + assert(! m.unlock)
  1022. + end
  1023. +
  1024. + def test_mutex_join
  1025. + m = Mutex.new
  1026. + m.lock
  1027. + wt2 = Thread.new do
  1028. + m.lock
  1029. + sleep 0.5
  1030. + m.unlock
  1031. + end
  1032. +
  1033. + # Ensure wt2 is waiting on m
  1034. + sleep 0.1
  1035. +
  1036. + wt1 = Thread.new do
  1037. + m.lock
  1038. + m.unlock
  1039. + end
  1040. + # Ensure wt1 is waiting on m
  1041. + sleep 0.1
  1042. +
  1043. + # Give it to wt2
  1044. + m.unlock
  1045. +
  1046. + assert_nothing_raised {wt1.join}
  1047. + end
  1048. end
  1049. diff --git a/version.h b/version.h
  1050. index 3d64d07..293cd6e 100644
  1051. --- a/version.h
  1052. +++ b/version.h
  1053. @@ -2,7 +2,7 @@
  1054. #define RUBY_RELEASE_DATE "2012-06-06"
  1055. #define RUBY_VERSION_CODE 187
  1056. #define RUBY_RELEASE_CODE 20120606
  1057. -#define RUBY_PATCHLEVEL 365
  1058. +#define RUBY_PATCHLEVEL 366
  1059. #define RUBY_VERSION_MAJOR 1
  1060. #define RUBY_VERSION_MINOR 8
  1061. --
  1062. 1.8.5.1
  1063. From 15fbb87b594a47ed622829cfdd6891eb97ea4726 Mon Sep 17 00:00:00 2001
  1064. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1065. Date: Thu, 7 Jun 2012 10:05:59 +0000
  1066. Subject: [PATCH 11/19] merge revision(s) 30993: *
  1067. ext/bigdecimal/bigdecimal.c (VpMemAlloc): Fixes a bug reported by Drew Yao
  1068. <ayao at apple.com>
  1069. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1070. ---
  1071. ChangeLog | 5 +++++
  1072. ext/bigdecimal/bigdecimal.c | 8 ++++----
  1073. version.h | 8 ++++----
  1074. 3 files changed, 13 insertions(+), 8 deletions(-)
  1075. diff --git a/ChangeLog b/ChangeLog
  1076. index 8956096..3ac2f87 100644
  1077. --- a/ChangeLog
  1078. +++ b/ChangeLog
  1079. @@ -1,3 +1,8 @@
  1080. +Thu Jun 7 19:00:35 2012 Kenta Murata <mrkn@mrkn.jp>
  1081. +
  1082. + * ext/bigdecimal/bigdecimal.c (VpMemAlloc): Fixes a bug reported
  1083. + by Drew Yao <ayao at apple.com>
  1084. +
  1085. Wed Jun 6 15:09:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  1086. * eval.c (rb_thread_join), ext/thread/thread.c (wake_one): adjusts
  1087. diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
  1088. index 16be520..7ebb3f7 100644
  1089. --- a/ext/bigdecimal/bigdecimal.c
  1090. +++ b/ext/bigdecimal/bigdecimal.c
  1091. @@ -2032,11 +2032,11 @@
  1092. VP_EXPORT void *
  1093. VpMemAlloc(U_LONG mb)
  1094. {
  1095. - void *p = xmalloc((unsigned int)mb);
  1096. - if(!p) {
  1097. - VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1);
  1098. + void *p = xmalloc(mb);
  1099. + if (!p) {
  1100. + VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1);
  1101. }
  1102. - memset(p,0,mb);
  1103. + memset(p, 0, mb);
  1104. #ifdef _DEBUG
  1105. gnAlloc++; /* Count allocation call */
  1106. #endif /* _DEBUG */
  1107. diff --git a/version.h b/version.h
  1108. index 293cd6e..7a53a5c 100644
  1109. --- a/version.h
  1110. +++ b/version.h
  1111. @@ -1,15 +1,15 @@
  1112. #define RUBY_VERSION "1.8.7"
  1113. -#define RUBY_RELEASE_DATE "2012-06-06"
  1114. +#define RUBY_RELEASE_DATE "2012-06-07"
  1115. #define RUBY_VERSION_CODE 187
  1116. -#define RUBY_RELEASE_CODE 20120606
  1117. -#define RUBY_PATCHLEVEL 366
  1118. +#define RUBY_RELEASE_CODE 20120607
  1119. +#define RUBY_PATCHLEVEL 367
  1120. #define RUBY_VERSION_MAJOR 1
  1121. #define RUBY_VERSION_MINOR 8
  1122. #define RUBY_VERSION_TEENY 7
  1123. #define RUBY_RELEASE_YEAR 2012
  1124. #define RUBY_RELEASE_MONTH 6
  1125. -#define RUBY_RELEASE_DAY 6
  1126. +#define RUBY_RELEASE_DAY 7
  1127. #ifdef RUBY_EXTERN
  1128. RUBY_EXTERN const char ruby_version[];
  1129. --
  1130. 1.8.5.1
  1131. From ef73b34c87f52be6a87e0f7ab8d5a03bfcaa983f Mon Sep 17 00:00:00 2001
  1132. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1133. Date: Sat, 9 Jun 2012 18:12:07 +0000
  1134. Subject: [PATCH 12/19] merge revision(s) 32542: * eval.c
  1135. (ruby_setjmp): need to save the stack after r2 (the Table of Contents
  1136. on ppc64) is saved onto the stack by getcontext(). based on
  1137. <https://bugzilla.redhat.com/show_bug.cgi?id=628715>. Bug#4411
  1138. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1139. ---
  1140. ChangeLog | 7 +++++++
  1141. eval.c | 18 ++++++++++++++----
  1142. version.h | 8 ++++----
  1143. 3 files changed, 25 insertions(+), 8 deletions(-)
  1144. diff --git a/ChangeLog b/ChangeLog
  1145. index 3ac2f87..9637df1 100644
  1146. --- a/ChangeLog
  1147. +++ b/ChangeLog
  1148. @@ -1,3 +1,10 @@
  1149. +Sun Jun 10 03:00:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  1150. +
  1151. + * eval.c (ruby_setjmp): need to save the stack after r2 (the Table
  1152. + of Contents on ppc64) is saved onto the stack by getcontext().
  1153. + based on <https://bugzilla.redhat.com/show_bug.cgi?id=628715>.
  1154. + Bug#4411
  1155. +
  1156. Thu Jun 7 19:00:35 2012 Kenta Murata <mrkn@mrkn.jp>
  1157. * ext/bigdecimal/bigdecimal.c (VpMemAlloc): Fixes a bug reported
  1158. diff --git a/eval.c b/eval.c
  1159. index c350159..4458dff 100644
  1160. --- a/eval.c
  1161. +++ b/eval.c
  1162. @@ -179,6 +179,9 @@
  1163. (function_call_may_return_twice_false_2 ? \
  1164. setjmp(function_call_may_return_twice_jmp_buf) : \
  1165. 0)
  1166. +# elif defined(__PPC64__)
  1167. +# define JUST_BEFORE_SETJMP(extra_save, j) ((void)0)
  1168. +# define JUST_AFTER_SETJMP(extra_save, j) ((j)->status ? (void)0 : (extra_save))
  1169. # elif defined(__FreeBSD__) && __FreeBSD__ < 7
  1170. /*
  1171. * workaround for FreeBSD/i386 getcontext/setcontext bug.
  1172. @@ -196,16 +199,23 @@
  1173. # ifndef POST_GETCONTEXT
  1174. # define POST_GETCONTEXT 0
  1175. # endif
  1176. +# ifndef JUST_BEFORE_SETJMP
  1177. +# define JUST_BEFORE_SETJMP(extra_save, j) (extra_save)
  1178. +# endif
  1179. +# ifndef JUST_AFTER_SETJMP
  1180. +# define JUST_AFTER_SETJMP(extra_save, j) ((void)0)
  1181. +# endif
  1182. # define ruby_longjmp(env, val) rb_jump_context(env, val)
  1183. -# define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \
  1184. - (just_before_setjmp), \
  1185. +# define ruby_setjmp(extra_save, j) ((j)->status = 0, \
  1186. + JUST_BEFORE_SETJMP(extra_save, j), \
  1187. PRE_GETCONTEXT, \
  1188. getcontext(&(j)->context), \
  1189. POST_GETCONTEXT, \
  1190. + JUST_AFTER_SETJMP(extra_save, j), \
  1191. (j)->status)
  1192. #else
  1193. -# define ruby_setjmp(just_before_setjmp, env) \
  1194. - ((just_before_setjmp), RUBY_SETJMP(env))
  1195. +# define ruby_setjmp(extra_save, env) \
  1196. + ((extra_save), RUBY_SETJMP(env))
  1197. # define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
  1198. # ifdef __CYGWIN__
  1199. int _setjmp(), _longjmp();
  1200. diff --git a/version.h b/version.h
  1201. index 7a53a5c..6341599 100644
  1202. --- a/version.h
  1203. +++ b/version.h
  1204. @@ -1,15 +1,15 @@
  1205. #define RUBY_VERSION "1.8.7"
  1206. -#define RUBY_RELEASE_DATE "2012-06-07"
  1207. +#define RUBY_RELEASE_DATE "2012-06-10"
  1208. #define RUBY_VERSION_CODE 187
  1209. -#define RUBY_RELEASE_CODE 20120607
  1210. -#define RUBY_PATCHLEVEL 367
  1211. +#define RUBY_RELEASE_CODE 20120610
  1212. +#define RUBY_PATCHLEVEL 368
  1213. #define RUBY_VERSION_MAJOR 1
  1214. #define RUBY_VERSION_MINOR 8
  1215. #define RUBY_VERSION_TEENY 7
  1216. #define RUBY_RELEASE_YEAR 2012
  1217. #define RUBY_RELEASE_MONTH 6
  1218. -#define RUBY_RELEASE_DAY 7
  1219. +#define RUBY_RELEASE_DAY 10
  1220. #ifdef RUBY_EXTERN
  1221. RUBY_EXTERN const char ruby_version[];
  1222. --
  1223. 1.8.5.1
  1224. From d761c9b178d8a2b7757ca5ea41135c7ea37c70b2 Mon Sep 17 00:00:00 2001
  1225. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1226. Date: Mon, 18 Jun 2012 09:53:29 +0000
  1227. Subject: [PATCH 13/19] merge revision(s) 32605:32610: * backport r32609 from
  1228. trunk. * ext/openssl/ossl_hmac.c: Revert checking return type of
  1229. HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0. * backport
  1230. r32606 from trunk. * ext/openssl/ossl_digest.c: Check return value of
  1231. EVP_DigestInit_ex. * ext/openssl/ossl_hmac.c: Check return value of
  1232. HMAC_Init_ex. Thanks, Jared Jennings, for the patch. [ Ruby 1.9 -
  1233. Bug #4944 ] [ruby-core:37670]
  1234. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@36126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1235. ---
  1236. ChangeLog | 16 ++++++++++++++++
  1237. ext/openssl/ossl_digest.c | 12 +++++++++---
  1238. version.h | 8 ++++----
  1239. 3 files changed, 29 insertions(+), 7 deletions(-)
  1240. diff --git a/ChangeLog b/ChangeLog
  1241. index 9637df1..e7445fa 100644
  1242. --- a/ChangeLog
  1243. +++ b/ChangeLog
  1244. @@ -1,3 +1,19 @@
  1245. +Mon Jun 18 18:32:43 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
  1246. +
  1247. + * backport r32609 from trunk.
  1248. +
  1249. + * ext/openssl/ossl_hmac.c: Revert checking return type of
  1250. + HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.
  1251. +
  1252. +Mon Jun 18 18:32:43 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
  1253. +
  1254. + * backport r32606 from trunk.
  1255. +
  1256. + * ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.
  1257. + * ext/openssl/ossl_hmac.c: Check return value of HMAC_Init_ex.
  1258. + Thanks, Jared Jennings, for the patch.
  1259. + [ Ruby 1.9 - Bug #4944 ] [ruby-core:37670]
  1260. +
  1261. Sun Jun 10 03:00:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  1262. * eval.c (ruby_setjmp): need to save the stack after r2 (the Table
  1263. diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c
  1264. index 879d399..13111ce 100644
  1265. --- a/ext/openssl/ossl_digest.c
  1266. +++ b/ext/openssl/ossl_digest.c
  1267. @@ -62,7 +62,9 @@
  1268. ret = ossl_digest_alloc(cDigest);
  1269. GetDigest(ret, ctx);
  1270. - EVP_DigestInit_ex(ctx, md, NULL);
  1271. + if (EVP_DigestInit_ex(ctx, md, NULL) != 1) {
  1272. + ossl_raise(eDigestError, "Digest initialization failed.");
  1273. + }
  1274. return ret;
  1275. }
  1276. @@ -104,7 +106,9 @@
  1277. if (!NIL_P(data)) StringValue(data);
  1278. GetDigest(self, ctx);
  1279. - EVP_DigestInit_ex(ctx, md, NULL);
  1280. + if (EVP_DigestInit_ex(ctx, md, NULL) != 1) {
  1281. + ossl_raise(eDigestError, "Digest initialization failed.");
  1282. + }
  1283. if (!NIL_P(data)) return ossl_digest_update(self, data);
  1284. return self;
  1285. @@ -138,7 +142,9 @@
  1286. EVP_MD_CTX *ctx;
  1287. GetDigest(self, ctx);
  1288. - EVP_DigestInit_ex(ctx, EVP_MD_CTX_md(ctx), NULL);
  1289. + if (EVP_DigestInit_ex(ctx, EVP_MD_CTX_md(ctx), NULL) != 1) {
  1290. + ossl_raise(eDigestError, "Digest initialization failed.");
  1291. + }
  1292. return self;
  1293. }
  1294. diff --git a/version.h b/version.h
  1295. index 6341599..7b2f01a 100644
  1296. --- a/version.h
  1297. +++ b/version.h
  1298. @@ -1,15 +1,15 @@
  1299. #define RUBY_VERSION "1.8.7"
  1300. -#define RUBY_RELEASE_DATE "2012-06-10"
  1301. +#define RUBY_RELEASE_DATE "2012-06-18"
  1302. #define RUBY_VERSION_CODE 187
  1303. -#define RUBY_RELEASE_CODE 20120610
  1304. -#define RUBY_PATCHLEVEL 368
  1305. +#define RUBY_RELEASE_CODE 20120618
  1306. +#define RUBY_PATCHLEVEL 369
  1307. #define RUBY_VERSION_MAJOR 1
  1308. #define RUBY_VERSION_MINOR 8
  1309. #define RUBY_VERSION_TEENY 7
  1310. #define RUBY_RELEASE_YEAR 2012
  1311. #define RUBY_RELEASE_MONTH 6
  1312. -#define RUBY_RELEASE_DAY 10
  1313. +#define RUBY_RELEASE_DAY 18
  1314. #ifdef RUBY_EXTERN
  1315. RUBY_EXTERN const char ruby_version[];
  1316. --
  1317. 1.8.5.1
  1318. From e48d99f0e574a36f0e9c7337b396a437cbff4cc5 Mon Sep 17 00:00:00 2001
  1319. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1320. Date: Fri, 29 Jun 2012 12:31:25 +0000
  1321. Subject: [PATCH 14/19] merge revision(s) 36251: * eval.c
  1322. (stack_extend): prevent ALLOCA_N, which reserves a memory space with
  1323. for restoring machine stack stored in each threads, from optimization
  1324. out. backport r34278 from the trunk.
  1325. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@36253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1326. ---
  1327. ChangeLog | 6 ++++++
  1328. eval.c | 2 ++
  1329. version.h | 8 ++++----
  1330. 3 files changed, 12 insertions(+), 4 deletions(-)
  1331. diff --git a/ChangeLog b/ChangeLog
  1332. index e7445fa..2d4bcb0 100644
  1333. --- a/ChangeLog
  1334. +++ b/ChangeLog
  1335. @@ -1,3 +1,9 @@
  1336. +Fri Jun 29 21:26:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  1337. +
  1338. + * eval.c (stack_extend): prevent ALLOCA_N, which reserves a memory
  1339. + space with for restoring machine stack stored in each threads, from
  1340. + optimization out. backport r34278 from the trunk.
  1341. +
  1342. Mon Jun 18 18:32:43 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
  1343. * backport r32609 from trunk.
  1344. diff --git a/version.h b/version.h
  1345. index 7b2f01a..d90d5b1 100644
  1346. --- a/version.h
  1347. +++ b/version.h
  1348. @@ -1,15 +1,15 @@
  1349. #define RUBY_VERSION "1.8.7"
  1350. -#define RUBY_RELEASE_DATE "2012-06-18"
  1351. +#define RUBY_RELEASE_DATE "2012-06-29"
  1352. #define RUBY_VERSION_CODE 187
  1353. -#define RUBY_RELEASE_CODE 20120618
  1354. -#define RUBY_PATCHLEVEL 369
  1355. +#define RUBY_RELEASE_CODE 20120629
  1356. +#define RUBY_PATCHLEVEL 370
  1357. #define RUBY_VERSION_MAJOR 1
  1358. #define RUBY_VERSION_MINOR 8
  1359. #define RUBY_VERSION_TEENY 7
  1360. #define RUBY_RELEASE_YEAR 2012
  1361. #define RUBY_RELEASE_MONTH 6
  1362. -#define RUBY_RELEASE_DAY 18
  1363. +#define RUBY_RELEASE_DAY 29
  1364. #ifdef RUBY_EXTERN
  1365. RUBY_EXTERN const char ruby_version[];
  1366. --
  1367. 1.8.5.1
  1368. From 2ac236dcbd90bd33bfeac4f699763c3baef4038e Mon Sep 17 00:00:00 2001
  1369. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1370. Date: Fri, 12 Oct 2012 04:05:35 +0000
  1371. Subject: [PATCH 15/19] * error.c (name_err_to_s): we need not infect msg.
  1372. * test/ruby/test_exception.rb (TestException#test_exception_to_s_should_not_propagate_untrustedness): test for it.
  1373. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@37148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1374. ---
  1375. ChangeLog | 6 ++++++
  1376. error.c | 3 ---
  1377. test/ruby/test_exception.rb | 30 +++++++++++++++++++++++++++++-
  1378. version.h | 10 +++++-----
  1379. 4 files changed, 40 insertions(+), 9 deletions(-)
  1380. diff --git a/ChangeLog b/ChangeLog
  1381. index 2d4bcb0..e2e1059 100644
  1382. --- a/ChangeLog
  1383. +++ b/ChangeLog
  1384. @@ -1,3 +1,9 @@
  1385. +Fri Oct 12 12:25:15 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
  1386. +
  1387. + * error.c (name_err_to_s): we need not infect msg.
  1388. +
  1389. + * test/ruby/test_exception.rb (TestException#test_exception_to_s_should_not_propagate_untrustedness): test for it.
  1390. +
  1391. Fri Jun 29 21:26:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  1392. * eval.c (stack_extend): prevent ALLOCA_N, which reserves a memory
  1393. diff --git a/error.c b/error.c
  1394. index 59b445e..2b3bf3f 100644
  1395. --- a/error.c
  1396. +++ b/error.c
  1397. @@ -665,9 +665,6 @@
  1398. if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
  1399. StringValue(str);
  1400. - if (str != mesg) {
  1401. - OBJ_INFECT(str, mesg);
  1402. - }
  1403. return str;
  1404. }
  1405. diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
  1406. index c5f4091..434838f 100644
  1407. --- a/test/ruby/test_exception.rb
  1408. +++ b/test/ruby/test_exception.rb
  1409. @@ -204,6 +204,34 @@ def o.to_str
  1410. o.taint
  1411. e = NameError.new(o)
  1412. s = e.to_s
  1413. - assert_equal(true, s.tainted?)
  1414. + assert_equal(false, s.tainted?)
  1415. + end
  1416. +
  1417. + def test_exception_to_s_should_not_propagate_untrustedness
  1418. + favorite_lang = "Ruby"
  1419. +
  1420. + for exc in [Exception, NameError]
  1421. + assert_raise(SecurityError) do
  1422. + lambda {
  1423. + $SAFE = 4
  1424. + exc.new(favorite_lang).to_s
  1425. + favorite_lang.replace("Python")
  1426. + }.call
  1427. + end
  1428. + end
  1429. +
  1430. + assert_raise(SecurityError) do
  1431. + lambda {
  1432. + $SAFE = 4
  1433. + o = Object.new
  1434. + (class << o; self; end).send(:define_method, :to_str) {
  1435. + favorite_lang
  1436. + }
  1437. + NameError.new(o).to_s
  1438. + favorite_lang.replace("Python")
  1439. + }.call
  1440. + end
  1441. +
  1442. + assert_equal("Ruby", favorite_lang)
  1443. end
  1444. end
  1445. diff --git a/version.h b/version.h
  1446. index d90d5b1..e509ed2 100644
  1447. --- a/version.h
  1448. +++ b/version.h
  1449. @@ -1,15 +1,15 @@
  1450. #define RUBY_VERSION "1.8.7"
  1451. -#define RUBY_RELEASE_DATE "2012-06-29"
  1452. +#define RUBY_RELEASE_DATE "2012-10-12"
  1453. #define RUBY_VERSION_CODE 187
  1454. -#define RUBY_RELEASE_CODE 20120629
  1455. -#define RUBY_PATCHLEVEL 370
  1456. +#define RUBY_RELEASE_CODE 20121012
  1457. +#define RUBY_PATCHLEVEL 371
  1458. #define RUBY_VERSION_MAJOR 1
  1459. #define RUBY_VERSION_MINOR 8
  1460. #define RUBY_VERSION_TEENY 7
  1461. #define RUBY_RELEASE_YEAR 2012
  1462. -#define RUBY_RELEASE_MONTH 6
  1463. -#define RUBY_RELEASE_DAY 29
  1464. +#define RUBY_RELEASE_MONTH 10
  1465. +#define RUBY_RELEASE_DAY 12
  1466. #ifdef RUBY_EXTERN
  1467. RUBY_EXTERN const char ruby_version[];
  1468. --
  1469. 1.8.5.1
  1470. From eca9bf617ab517b73598f449388b543d19c72b7d Mon Sep 17 00:00:00 2001
  1471. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1472. Date: Sat, 18 May 2013 14:55:14 +0000
  1473. Subject: [PATCH 16/19] merge revision(s) 39384,39509,39511: [Backport #7961]
  1474. * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
  1475. new attribute to read/write entity expansion text limit. the default
  1476. limit is 10Kb.
  1477. * lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute.
  1478. * lib/rexml/document.rb: move entity_expansion_limit accessor to ...
  1479. * lib/rexml/rexml.rb: ... here to make rexml/text independent from
  1480. REXML::Document. It causes circular require.
  1481. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
  1482. deprecated.
  1483. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
  1484. deprecated.
  1485. * lib/rexml/text.rb: add missing require "rexml/rexml" for
  1486. REXML.entity_expansion_limit.
  1487. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]
  1488. * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...
  1489. * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
  1490. * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
  1491. REXML.entity_expansion_text_limit.
  1492. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@40812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1493. ---
  1494. ChangeLog | 21 ++++++++++++++++++++
  1495. lib/rexml/document.rb | 14 ++++++++++++++
  1496. lib/rexml/rexml.rb | 12 ++++++++++++
  1497. lib/rexml/text.rb | 53 +++++++++++++++++++++++++--------------------------
  1498. version.h | 12 ++++++------
  1499. 5 files changed, 79 insertions(+), 33 deletions(-)
  1500. diff --git a/ChangeLog b/ChangeLog
  1501. index e2e1059..c80774f 100644
  1502. --- a/ChangeLog
  1503. +++ b/ChangeLog
  1504. @@ -1,3 +1,24 @@
  1505. +Sat May 18 23:34:50 2013 Kouhei Sutou <kou@cozmixng.org>
  1506. +
  1507. + * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...
  1508. + * lib/rexml/rexml.rb: ... here to make rexml/text independent from
  1509. + REXML::Document. It causes circular require.
  1510. + * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
  1511. + deprecated.
  1512. + * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
  1513. + deprecated.
  1514. + * lib/rexml/text.rb: add missing require "rexml/rexml" for
  1515. + REXML.entity_expansion_text_limit.
  1516. + Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]
  1517. +
  1518. +Sat May 18 23:34:50 2013 Aaron Patterson <aaron@tenderlovemaking.com>
  1519. +
  1520. + * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
  1521. + new attribute to read/write entity expansion text limit. the default
  1522. + limit is 10Kb.
  1523. +
  1524. + * lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute.
  1525. +
  1526. Fri Oct 12 12:25:15 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
  1527. * error.c (name_err_to_s): we need not infect msg.
  1528. diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb
  1529. index 3d1300a..16a2c77 100644
  1530. --- a/lib/rexml/document.rb
  1531. +++ b/lib/rexml/document.rb
  1532. @@ -213,6 +213,20 @@ def Document::entity_expansion_limit
  1533. return @@entity_expansion_limit
  1534. end
  1535. + # Set the entity expansion limit. By default the limit is set to 10240.
  1536. + #
  1537. + # Deprecated. Use REXML.entity_expansion_text_limit= instead.
  1538. + def Document::entity_expansion_text_limit=( val )
  1539. + REXML.entity_expansion_text_limit = val
  1540. + end
  1541. +
  1542. + # Get the entity expansion limit. By default the limit is set to 10000.
  1543. + #
  1544. + # Deprecated. Use REXML.entity_expansion_text_limit instead.
  1545. + def Document::entity_expansion_text_limit
  1546. + return REXML.entity_expansion_text_limit
  1547. + end
  1548. +
  1549. attr_reader :entity_expansion_count
  1550. def record_entity_expansion
  1551. diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb
  1552. index 95bc2a7..8845300 100644
  1553. --- a/lib/rexml/rexml.rb
  1554. +++ b/lib/rexml/rexml.rb
  1555. @@ -29,4 +29,16 @@ module REXML
  1556. Copyright = COPYRIGHT
  1557. Version = VERSION
  1558. +
  1559. + @@entity_expansion_text_limit = 10_240
  1560. +
  1561. + # Set the entity expansion limit. By default the limit is set to 10240.
  1562. + def self.entity_expansion_text_limit=( val )
  1563. + @@entity_expansion_text_limit = val
  1564. + end
  1565. +
  1566. + # Get the entity expansion limit. By default the limit is set to 10240.
  1567. + def self.entity_expansion_text_limit
  1568. + return @@entity_expansion_text_limit
  1569. + end
  1570. end
  1571. diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
  1572. index a4a30b6..b6dbf45 100644
  1573. --- a/lib/rexml/text.rb
  1574. +++ b/lib/rexml/text.rb
  1575. @@ -1,3 +1,4 @@
  1576. +require 'rexml/rexml'
  1577. require 'rexml/entity'
  1578. require 'rexml/doctype'
  1579. require 'rexml/child'
  1580. @@ -308,37 +309,35 @@ def Text::normalize( input, doctype=nil, entity_filter=nil )
  1581. # Unescapes all possible entities
  1582. def Text::unnormalize( string, doctype=nil, filter=nil, illegal=nil )
  1583. - rv = string.clone
  1584. - rv.gsub!( /\r\n?/, "\n" )
  1585. - matches = rv.scan( REFERENCE )
  1586. - return rv if matches.size == 0
  1587. - rv.gsub!( NUMERICENTITY ) {|m|
  1588. - m=$1
  1589. - m = "0#{m}" if m[0] == ?x
  1590. - [Integer(m)].pack('U*')
  1591. + sum = 0
  1592. + string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) {
  1593. + s = Text.expand($&, doctype, filter)
  1594. + if sum + s.bytesize > REXML.entity_expansion_text_limit
  1595. + raise "entity expansion has grown too large"
  1596. + else
  1597. + sum += s.bytesize
  1598. + end
  1599. + s
  1600. }
  1601. - matches.collect!{|x|x[0]}.compact!
  1602. - if matches.size > 0
  1603. - if doctype
  1604. - matches.each do |entity_reference|
  1605. - unless filter and filter.include?(entity_reference)
  1606. - entity_value = doctype.entity( entity_reference )
  1607. - re = /&#{entity_reference};/
  1608. - rv.gsub!( re, entity_value ) if entity_value
  1609. - end
  1610. - end
  1611. + end
  1612. +
  1613. + def Text.expand(ref, doctype, filter)
  1614. + if ref[1] == ?#
  1615. + if ref[2] == ?x
  1616. + [ref[3...-1].to_i(16)].pack('U*')
  1617. else
  1618. - matches.each do |entity_reference|
  1619. - unless filter and filter.include?(entity_reference)
  1620. - entity_value = DocType::DEFAULT_ENTITIES[ entity_reference ]
  1621. - re = /&#{entity_reference};/
  1622. - rv.gsub!( re, entity_value.value ) if entity_value
  1623. - end
  1624. - end
  1625. + [ref[2...-1].to_i].pack('U*')
  1626. end
  1627. - rv.gsub!( /&amp;/, '&' )
  1628. + elsif ref == '&amp;'
  1629. + '&'
  1630. + elsif filter and filter.include?( ref[1...-1] )
  1631. + ref
  1632. + elsif doctype
  1633. + doctype.entity( ref[1...-1] ) or ref
  1634. + else
  1635. + entity_value = DocType::DEFAULT_ENTITIES[ ref[1...-1] ]
  1636. + entity_value ? entity_value.value : ref
  1637. end
  1638. - rv
  1639. end
  1640. end
  1641. end
  1642. diff --git a/version.h b/version.h
  1643. index e509ed2..2158647 100644
  1644. --- a/version.h
  1645. +++ b/version.h
  1646. @@ -1,15 +1,15 @@
  1647. #define RUBY_VERSION "1.8.7"
  1648. -#define RUBY_RELEASE_DATE "2012-10-12"
  1649. +#define RUBY_RELEASE_DATE "2013-05-18"
  1650. #define RUBY_VERSION_CODE 187
  1651. -#define RUBY_RELEASE_CODE 20121012
  1652. -#define RUBY_PATCHLEVEL 371
  1653. +#define RUBY_RELEASE_CODE 20130518
  1654. +#define RUBY_PATCHLEVEL 372
  1655. #define RUBY_VERSION_MAJOR 1
  1656. #define RUBY_VERSION_MINOR 8
  1657. #define RUBY_VERSION_TEENY 7
  1658. -#define RUBY_RELEASE_YEAR 2012
  1659. -#define RUBY_RELEASE_MONTH 10
  1660. -#define RUBY_RELEASE_DAY 12
  1661. +#define RUBY_RELEASE_YEAR 2013
  1662. +#define RUBY_RELEASE_MONTH 5
  1663. +#define RUBY_RELEASE_DAY 18
  1664. #ifdef RUBY_EXTERN
  1665. RUBY_EXTERN const char ruby_version[];
  1666. --
  1667. 1.8.5.1
  1668. From 961bf7496ded3acfe847cf56fa90bbdcfd6e614f Mon Sep 17 00:00:00 2001
  1669. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1670. Date: Thu, 27 Jun 2013 11:22:26 +0000
  1671. Subject: [PATCH 17/19] * ext/openssl/lib/openssl/ssl-internal.rb
  1672. (OpenSSL::SSL#verify_certificate_identity): fix hostname verification.
  1673. Patch by nahi.
  1674. * test/openssl/test_ssl.rb (OpenSSL#test_verify_certificate_identity):
  1675. test for above.
  1676. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@41676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1677. ---
  1678. ChangeLog | 8 ++++++++
  1679. ext/openssl/lib/openssl/ssl-internal.rb | 18 +++++++++++++-----
  1680. test/openssl/test_ssl.rb | 23 +++++++++++++++++++++++
  1681. version.h | 10 +++++-----
  1682. 4 files changed, 49 insertions(+), 10 deletions(-)
  1683. diff --git a/ChangeLog b/ChangeLog
  1684. index c80774f..cbba5f0 100644
  1685. --- a/ChangeLog
  1686. +++ b/ChangeLog
  1687. @@ -1,3 +1,11 @@
  1688. +Thu Jun 27 20:21:18 2013 URABE Shyouhei <shyouhei@ruby-lang.org>
  1689. +
  1690. + * ext/openssl/lib/openssl/ssl-internal.rb (OpenSSL::SSL#verify_certificate_identity):
  1691. + fix hostname verification. Patch by nahi.
  1692. +
  1693. + * test/openssl/test_ssl.rb (OpenSSL#test_verify_certificate_identity):
  1694. + test for above.
  1695. +
  1696. Sat May 18 23:34:50 2013 Kouhei Sutou <kou@cozmixng.org>
  1697. * lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...
  1698. diff --git a/ext/openssl/lib/openssl/ssl-internal.rb b/ext/openssl/lib/openssl/ssl-internal.rb
  1699. index abf0e8d..9ef6f92 100644
  1700. --- a/ext/openssl/lib/openssl/ssl-internal.rb
  1701. +++ b/ext/openssl/lib/openssl/ssl-internal.rb
  1702. @@ -90,14 +90,22 @@ def verify_certificate_identity(cert, hostname)
  1703. should_verify_common_name = true
  1704. cert.extensions.each{|ext|
  1705. next if ext.oid != "subjectAltName"
  1706. - ext.value.split(/,\s+/).each{|general_name|
  1707. - if /\ADNS:(.*)/ =~ general_name
  1708. + id, ostr = OpenSSL::ASN1.decode(ext.to_der).value
  1709. + sequence = OpenSSL::ASN1.decode(ostr.value)
  1710. + sequence.value.each{|san|
  1711. + case san.tag
  1712. + when 2 # dNSName in GeneralName (RFC5280)
  1713. should_verify_common_name = false
  1714. - reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
  1715. + reg = Regexp.escape(san.value).gsub(/\\\*/, "[^.]+")
  1716. return true if /\A#{reg}\z/i =~ hostname
  1717. - elsif /\AIP Address:(.*)/ =~ general_name
  1718. + when 7 # iPAddress in GeneralName (RFC5280)
  1719. should_verify_common_name = false
  1720. - return true if $1 == hostname
  1721. + # follows GENERAL_NAME_print() in x509v3/v3_alt.c
  1722. + if san.value.size == 4
  1723. + return true if san.value.unpack('C*').join('.') == hostname
  1724. + elsif san.value.size == 16
  1725. + return true if san.value.unpack('n*').map { |e| sprintf("%X", e) }.join(':') == hostname
  1726. + end
  1727. end
  1728. }
  1729. }
  1730. diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
  1731. index 177b684..098ccdd 100644
  1732. --- a/test/openssl/test_ssl.rb
  1733. +++ b/test/openssl/test_ssl.rb
  1734. @@ -547,6 +547,29 @@ def test_unset_OP_ALL
  1735. ssl.close
  1736. }
  1737. end
  1738. +
  1739. + def test_verify_certificate_identity
  1740. + # creating NULL byte SAN certificate
  1741. + ef = OpenSSL::X509::ExtensionFactory.new
  1742. + cert = OpenSSL::X509::Certificate.new
  1743. + cert.subject = OpenSSL::X509::Name.parse "/DC=some/DC=site/CN=Some Site"
  1744. + ext = ef.create_ext('subjectAltName', 'DNS:placeholder,IP:192.168.7.1,IP:13::17')
  1745. + ext_asn1 = OpenSSL::ASN1.decode(ext.to_der)
  1746. + san_list_der = ext_asn1.value.reduce(nil) { |memo,val| val.tag == 4 ? val.value : memo }
  1747. + san_list_asn1 = OpenSSL::ASN1.decode(san_list_der)
  1748. + san_list_asn1.value[0].value = 'www.example.com\0.evil.com'
  1749. + ext_asn1.value[1].value = san_list_asn1.to_der
  1750. + real_ext = OpenSSL::X509::Extension.new ext_asn1
  1751. + cert.add_extension(real_ext)
  1752. +
  1753. + assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, 'www.example.com'))
  1754. + assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, 'www.example.com\0.evil.com'))
  1755. + assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, '192.168.7.255'))
  1756. + assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, '192.168.7.1'))
  1757. + assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, '13::17'))
  1758. + assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, '13:0:0:0:0:0:0:17'))
  1759. + end
  1760. +L
  1761. end
  1762. end
  1763. diff --git a/version.h b/version.h
  1764. index 2158647..97111c5 100644
  1765. --- a/version.h
  1766. +++ b/version.h
  1767. @@ -1,15 +1,15 @@
  1768. #define RUBY_VERSION "1.8.7"
  1769. -#define RUBY_RELEASE_DATE "2013-05-18"
  1770. +#define RUBY_RELEASE_DATE "2013-06-27"
  1771. #define RUBY_VERSION_CODE 187
  1772. -#define RUBY_RELEASE_CODE 20130518
  1773. -#define RUBY_PATCHLEVEL 372
  1774. +#define RUBY_RELEASE_CODE 20130627
  1775. +#define RUBY_PATCHLEVEL 373
  1776. #define RUBY_VERSION_MAJOR 1
  1777. #define RUBY_VERSION_MINOR 8
  1778. #define RUBY_VERSION_TEENY 7
  1779. #define RUBY_RELEASE_YEAR 2013
  1780. -#define RUBY_RELEASE_MONTH 5
  1781. -#define RUBY_RELEASE_DAY 18
  1782. +#define RUBY_RELEASE_MONTH 6
  1783. +#define RUBY_RELEASE_DAY 27
  1784. #ifdef RUBY_EXTERN
  1785. RUBY_EXTERN const char ruby_version[];
  1786. --
  1787. 1.8.5.1
  1788. From 469d4b9389cc2f877f2f17ba248146831d69c66b Mon Sep 17 00:00:00 2001
  1789. From: shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  1790. Date: Thu, 27 Jun 2013 11:56:26 +0000
  1791. Subject: [PATCH 18/19] Oops, sorry!
  1792. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@41678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  1793. ---
  1794. ChangeLog | 4 ++++
  1795. test/openssl/test_ssl.rb | 1 -
  1796. version.h | 2 +-
  1797. 3 files changed, 5 insertions(+), 2 deletions(-)
  1798. diff --git a/ChangeLog b/ChangeLog
  1799. index cbba5f0..dbba29d 100644
  1800. --- a/ChangeLog
  1801. +++ b/ChangeLog
  1802. @@ -1,3 +1,7 @@
  1803. +Thu Jun 27 20:55:23 2013 URABE Shyouhei <shyouhei@ruby-lang.org>
  1804. +
  1805. + * test/openssl/test_ssl.rb: Oops, sorry!
  1806. +
  1807. Thu Jun 27 20:21:18 2013 URABE Shyouhei <shyouhei@ruby-lang.org>
  1808. * ext/openssl/lib/openssl/ssl-internal.rb (OpenSSL::SSL#verify_certificate_identity):
  1809. diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
  1810. index 098ccdd..2e014f1 100644
  1811. --- a/test/openssl/test_ssl.rb
  1812. +++ b/test/openssl/test_ssl.rb
  1813. @@ -569,7 +569,6 @@ def test_verify_certificate_identity
  1814. assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, '13::17'))
  1815. assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, '13:0:0:0:0:0:0:17'))
  1816. end
  1817. -L
  1818. end
  1819. end
  1820. diff --git a/version.h b/version.h
  1821. index 97111c5..6b6d57e 100644
  1822. --- a/version.h
  1823. +++ b/version.h
  1824. @@ -2,7 +2,7 @@
  1825. #define RUBY_RELEASE_DATE "2013-06-27"
  1826. #define RUBY_VERSION_CODE 187
  1827. #define RUBY_RELEASE_CODE 20130627
  1828. -#define RUBY_PATCHLEVEL 373
  1829. +#define RUBY_PATCHLEVEL 374
  1830. #define RUBY_VERSION_MAJOR 1
  1831. #define RUBY_VERSION_MINOR 8
  1832. --
  1833. 1.8.5.1