ruby-changes:29181
From: akr <ko1@a...>
Date: Tue, 11 Jun 2013 23:03:04 +0900 (JST)
Subject: [ruby-changes:29181] akr:r41233 (trunk): * bignum.c (validate_integer_pack_format): Refine error messages.
akr 2013-06-11 23:02:46 +0900 (Tue, 11 Jun 2013) New Revision: 41233 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41233 Log: * bignum.c (validate_integer_pack_format): Refine error messages. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41232) +++ ChangeLog (revision 41233) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jun 11 23:01:57 2013 Tanaka Akira <akr@f...> + + * bignum.c (validate_integer_pack_format): Refine error messages. + Tue Jun 11 22:25:04 2013 Tanaka Akira <akr@f...> * bignum.c (validate_integer_pack_format): numwords argument added. Index: bignum.c =================================================================== --- bignum.c (revision 41232) +++ bignum.c (revision 41233) @@ -739,10 +739,16 @@ validate_integer_pack_format(size_t numw https://github.com/ruby/ruby/blob/trunk/bignum.c#L739 { int wordorder_bits = flags & INTEGER_PACK_WORDORDER_MASK; int byteorder_bits = flags & INTEGER_PACK_BYTEORDER_MASK; - if (wordorder_bits != INTEGER_PACK_MSWORD_FIRST && + if (wordorder_bits == 0) { + rb_raise(rb_eArgError, "word order not specified"); + } + else if (wordorder_bits != INTEGER_PACK_MSWORD_FIRST && wordorder_bits != INTEGER_PACK_LSWORD_FIRST) rb_raise(rb_eArgError, "unexpected word order"); - if (byteorder_bits != INTEGER_PACK_MSBYTE_FIRST && + if (byteorder_bits == 0) { + rb_raise(rb_eArgError, "byte order not specified"); + } + else if (byteorder_bits != INTEGER_PACK_MSBYTE_FIRST && byteorder_bits != INTEGER_PACK_LSBYTE_FIRST && byteorder_bits != INTEGER_PACK_NATIVE_BYTE_ORDER) rb_raise(rb_eArgError, "unexpected byte order"); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/