Commit Graph

7476 Commits

Author SHA1 Message Date
Francois Chagnon a384bcce35 Fix instances where return value of mrb_method_search_vm is unchecked
Reported by @charliesome
2016-11-24 10:51:29 -05:00
Yukihiro "Matz" Matsumoto a630c4f413 use MRB_PRId instead of %d for mrb_int 2016-11-24 22:10:54 +09:00
Yukihiro "Matz" Matsumoto 8602789067 Merge pull request #3277 from dabroz/feature-float-tolerance
Fixed float tolerance in tests when MRB_USE_FLOAT is set
2016-11-24 21:48:14 +09:00
Yukihiro "Matz" Matsumoto e289ba3eff Merge pull request #3276 from dabroz/author
Update AUTHORS
2016-11-24 21:28:55 +09:00
Yukihiro "Matz" Matsumoto 22f73250db redo should work well in for statement; fix #3275 2016-11-24 21:25:27 +09:00
Tomasz Dąbrowski 72ed7eebc3 Fixed Range.size to use proper floating point tolerance 2016-11-24 12:50:49 +01:00
Tomasz Dąbrowski a8b8abbd82 Fixed float tolerance in tests when MRB_USE_FLOAT is set 2016-11-24 12:48:41 +01:00
Tomasz Dąbrowski 3943ab5368 Update AUTHORS 2016-11-24 12:34:36 +01:00
Yukihiro "Matz" Matsumoto 0c924b9287 fixed a bug in self modifying Array#[]=; fix #3274 2016-11-24 19:30:21 +09:00
Yukihiro "Matz" Matsumoto cb5c9d3415 always call Hash#default if no key found; fix #3272 2016-11-24 18:09:04 +09:00
Yukihiro "Matz" Matsumoto 23c73ff399 Time#initialize_copy: Check if source time is initialized.
To prevent crash from nasty code like:

  class Time
    def initialize
    end
  end

  a = Time.new
  b = Time.new
  a.initialize_copy b
2016-11-24 13:50:36 +09:00
Yukihiro "Matz" Matsumoto cef7bd5416 Merge pull request #3271 from ksss/enum-take
Fix Enumeable#take some incompatibility
2016-11-24 11:31:28 +09:00
Yukihiro "Matz" Matsumoto 227daa8811 Relax 'void value expression' check that was too strict 2016-11-24 11:22:54 +09:00
ksss 5134734541 Shouldn't call each method if size is 0 2016-11-24 10:35:15 +09:00
ksss 9e2faec8e4 Support object does'n have < method 2016-11-24 10:34:14 +09:00
Yukihiro "Matz" Matsumoto 1c9593954b Add "void value expression" check to the parser. 2016-11-24 10:32:28 +09:00
Yukihiro "Matz" Matsumoto dc4be19aab Add forgotten loop_pop() in NODE_OP_ASGN codegen 2016-11-24 10:01:03 +09:00
Yukihiro "Matz" Matsumoto f5a86ca530 Add pointer casting from mrb_malloc(); ref #3267 2016-11-24 09:28:00 +09:00
Yukihiro "Matz" Matsumoto 798c69d1be Avoid casting from int to unsigned char for C++; ref #3267 2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski d7a6070d22 Fixed language standard mode for GCC (cannot use gnu99 with C++, c++03 used instead) 2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski c2a60eb8af Fix for Windows-specific mruby C++ issues 2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski 44c3859a97 Fix for compiling mruby as C++ on Visual Studio toolchain 2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski 18757c8f7b Different method of compiling C as C++ (-x c++) 2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski 00e6121260 Safeguard against trying to use C++ exception handling in C code 2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski 401ad4586f Add constant export declaration for MRBC output compiled as C++
Otherwise, C++ compilers will skip this constant when producing object files.
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski 1af9e363f2 Fixes for compiling mruby as C++ 2016-11-24 09:28:00 +09:00
Yukihiro "Matz" Matsumoto 477e12c182 Merge pull request #3269 from bouk/fix-printf-segfault
Fix segfault when Fixnum#chr doesn't return a string
2016-11-24 09:16:43 +09:00
Yukihiro "Matz" Matsumoto 2c28d00356 Merge pull request #3268 from bouk/fix-random-segfault
Fix segfault in Array#sample
2016-11-24 09:13:34 +09:00
Bouke van der Bijl 9bf1c0e1dc Fix segfault when Fixnum#chr doesn't return a string 2016-11-23 15:18:52 -05:00
Bouke van der Bijl c7262be0ae Fix segfault in Array#sample 2016-11-23 11:21:14 -05:00
Yukihiro "Matz" Matsumoto 669bbc70b0 codegen_scope should not keep old iseq ptr from irep 2016-11-23 21:08:35 +09:00
Yukihiro "Matz" Matsumoto bfbc6b9ea4 local_variables() should not touch unshared env 2016-11-23 20:50:14 +09:00
Yukihiro "Matz" Matsumoto efebbbbf26 Implement Float shift methods in C 2016-11-23 09:45:50 +09:00
Yukihiro "Matz" Matsumoto f414ed03d6 Merge pull request #3265 from dabroz/feature-fixexternc
Fixed C declaration in re.h
2016-11-22 22:22:47 +09:00
Tomasz Dąbrowski 52b40cb4d0 Fixed extern "C" to use MRB_BEGIN/END_DECL in re.h 2016-11-22 13:34:40 +01:00
Yukihiro "Matz" Matsumoto 8cba708854 int64_value(): use FIXABLE() 2016-11-22 19:11:54 +09:00
Yukihiro "Matz" Matsumoto fb7776586e hash value may be overflown from Integer
mruby special.
2016-11-22 18:00:04 +09:00
Yukihiro "Matz" Matsumoto be73905c9c accept floats as bit operator operands; fix #3260 2016-11-22 17:59:41 +09:00
Yukihiro "Matz" Matsumoto 8112295031 Removed fix_shift_get_width()
Fixnum is usually big enough for shift width.
2016-11-22 17:45:07 +09:00
Yukihiro "Matz" Matsumoto 740bf09740 add bit operators ~,&,|,^ to Float class (mruby special) 2016-11-22 17:36:26 +09:00
Yukihiro "Matz" Matsumoto a70104798e remove unnecessary ".!"; ref #3261 2016-11-22 16:55:18 +09:00
Yukihiro "Matz" Matsumoto bbaf3c242d Merge pull request #3261 from ksss/range-first
Reimplements Range#first
2016-11-22 16:38:24 +09:00
Yukihiro "Matz" Matsumoto 03e399accf Merge pull request #3262 from dabroz/feature-nanbox64fix
Fixed NaN boxing for 64-bit configrations
2016-11-22 16:36:43 +09:00
Yukihiro "Matz" Matsumoto de415b7bc0 Merge pull request #3264 from naclyhara/patch-1
Fix typo in test
2016-11-22 16:34:45 +09:00
Yutaka HARA aaa86a1fd5 Fix typo in test 2016-11-22 16:25:18 +09:00
Tomasz Dąbrowski b21b02465e asserts checking validity of pointer and TT added for mrb_obj_value
Useful for testing when using boxing on different platforms.
2016-11-21 12:37:45 +01:00
Tomasz Dąbrowski c385782cfe mrb_assert definition moved to the beggining of mruby.h
So that other files can immediately use it.
2016-11-21 12:37:45 +01:00
Tomasz Dąbrowski 8cdaf1ed35 Fixed NaN boxing for 64-bit configrations on platforms that use full 48-bit usermode pointers
Definition of boxed pointer is following:
`111111111111TTTT TTPPPPPPPPPPPPPP PPPPPPPPPPPPPPPP PPPPPPPPPPPPPPPP`

Previously, only the last 32-bit were set, and remaining 14 bits were zeroed when setting `ttt`.
2016-11-21 12:37:45 +01:00
Tomasz Dąbrowski d86f5d2dca mruby architecture detection 2016-11-21 12:37:45 +01:00
ksss 682237be6e Reimplements Range#first
Range#first shouldn't call `Range#to_a` on infinity range.
2016-11-21 16:55:49 +09:00