summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2016-02-22cosmetic change for OP_EQYukihiro "Matz" Matsumoto
2016-02-19mruby-struct: copied Struct length is not initialized; fix #3114Yukihiro "Matz" Matsumoto
2016-02-17peephole optimization for LOADNIL before STRCAT; ref #3110Yukihiro "Matz" Matsumoto
2016-02-17push value for NULL AST when value is required; fix #3110Yukihiro "Matz" Matsumoto
2016-02-17need to free context when reclaiming fiber object in GC; fix #3109Yukihiro "Matz" Matsumoto
2016-02-16syntax error in interpolated symbol; fixed #3108Yukihiro "Matz" Matsumoto
2016-02-16Merge pull request #3107 from mame/fix-enum-hashYukihiro "Matz" Matsumoto
[255, 255, 255, 255, 255].hash raises "can't convert Float into Integer"
2016-02-16Merge pull request #3106 from mame/fix-eval-no-filenameYukihiro "Matz" Matsumoto
Fix segfault when `eval("__FILE__")` is executed
2016-02-16suppress "can't convert Float into Integer" in Enumerable#hashYusuke Endoh
2016-02-15Fix segfault when `eval("__FILE__")` is executedYusuke Endoh
2016-02-12Merge pull request #3101 from deuwert/fix-test-buildYukihiro "Matz" Matsumoto
Fix bug in mruby-test gem (fix #3094)
2016-02-12Merge pull request #3102 from deuwert/add-limitsYukihiro "Matz" Matsumoto
Add more limitations
2016-02-12Fix formatting again...Daniel Bovensiepen
2016-02-12Add more limitations:Daniel Bovensiepen
- defined? - alias on global variables - Operator modification - Kernel.binding missing
2016-02-12Fix bug in mruby-test gem.Daniel Bovensiepen
In an used build path mruby-test wasn't updating mrbtest.c in the case that the mgem selection was changed. This lead to: - a missing reference in case a GEM was removed - ignoring all new GEMs added to the build configuration This fix keeps track of the active gems and demands a rebuild of mrbtest.c in case that the gem selection changed.
2016-02-12fixed typos in limitations.mdYukihiro "Matz" Matsumoto
2016-02-12Merge pull request #3100 from deuwert/toolchain-openwrtYukihiro "Matz" Matsumoto
Add toolchain support for OpenWRT
2016-02-12Merge pull request #3099 from deuwert/more-limitsYukihiro "Matz" Matsumoto
Addition to mruby limitation documentation
2016-02-11Add toolchain support for OpenWRTDaniel Bovensiepen
2016-02-11Fix formattingDaniel Bovensiepen
2016-02-11Add more limitationsDaniel Bovensiepen
2016-02-11add 1/2 description to limitations.md fileYukihiro "Matz" Matsumoto
2016-02-11Merge pull request #3098 from deuwert/limitationsYukihiro "Matz" Matsumoto
Limitations
2016-02-11Small format fixDaniel Bovensiepen
2016-02-11Add limitation fileDaniel Bovensiepen
2016-02-05[cppcheck] mrb_str_rindex() remove unnecessary len update by chars2bytes()Yukihiro "Matz" Matsumoto
2016-02-05[cppcheck] remove duplicated breakYukihiro "Matz" Matsumoto
2016-02-05Hash: check flags before accessing ifnone; ref #980Yukihiro "Matz" Matsumoto
2016-02-04cache UTF8 status for utf8_strlen(); ref #980Yukihiro "Matz" Matsumoto
2016-02-04cache mrb_regexp_p(); ref #980Yukihiro "Matz" Matsumoto
2016-02-04Merge pull request #3096 from hlogmans/masterYukihiro "Matz" Matsumoto
Fix missing dependency on mruby-print to support 'puts'
2016-02-03Fix missing dependency on mruby-print to support 'puts'Hugo Logmans
2016-01-31Merge pull request #3093 from retrage/retrage/devYukihiro "Matz" Matsumoto
Add String#rjust to mruby-string-ext
2016-01-31Merge pull request #3092 from kenhys/fix-suportedYukihiro "Matz" Matsumoto
Fix a typo
2016-01-31Fix a typoHAYASHI Kentaro
su ported -> supported ^
2016-01-30Add String#rjust test to mruby-string-extAkira Moroo
2016-01-30Add String#rjust to mruby-string-extAkira Moroo
2016-01-28Merge pull request #3091 from visualsayed/fix_hash_replace_methodYukihiro "Matz" Matsumoto
protect NoMethodError from calling to_hash in replace
2016-01-27protect NoMethodError from calling to_hash in replaceSayed Abdelhaleem
2016-01-22Merge pull request #3090 from kou/fix-segv-by-stack-extension-in-mrb-get-argsYukihiro "Matz" Matsumoto
Fix SEGV by stack extension in mrb_get_args()
2016-01-22Fix SEGV by stack extension in mrb_get_args()Kouhei Sutou
mrb_get_args() keeps pointer of the current stack. But address of the current stack maybe changed by method call. 'i' format character calls #to_i when the argument isn't integer but has #to_i. Here is a code that may call #to_i in mrb_get_args(): case 'i': // ... default: *p = mrb_fixnum(mrb_Integer(mrb, ARGV[arg_i])); break; // ... Here is a code #to_i is called: class X def initialize(i) @i = i end def to_i @i end end [][X.new(0), 0] # X#to_i is called So, mrb_get_args() shouldn't keep pointer and use it. mrb_get_args() should always refer mrb->ci->stack to use valid address of the current stack.
2016-01-21mruby-random: fixed wrong fixnum conversionYukihiro "Matz" Matsumoto
2016-01-20Merge pull request #3088 from maclover7/patch-1Yukihiro "Matz" Matsumoto
Small grammar fix
2016-01-19Small grammar fixJon Moss
[ci skip]
2016-01-19Merge pull request #3087 from kou/fix-segv-on-rerasing-no-memory-errorYukihiro "Matz" Matsumoto
Fix SEGV on re-raising NoMemoryError
2016-01-19Fix SEGV on re-raising NoMemoryErrorKouhei Sutou
Think about the following Ruby script: segv.rb: begin lambda do lambda do "x" * 1000 # NoMemoryError end.call end.call rescue raise end If memory can't allocate after `"x" * 1000`, mruby crashes. Because L_RAISE: block in mrb_vm_exec() calls mrb_env_unshare() via cipop() and mrb_env_unshare() uses allocated memory without NULL check: L_RAISE: block: L_RAISE: // ... while (ci[0].ridx == ci[-1].ridx) { cipop(mrb); // ... } cipop(): static void cipop(mrb_state *mrb) { struct mrb_context *c = mrb->c; if (c->ci->env) { mrb_env_unshare(mrb, c->ci->env); } c->ci--; } mrb_env_unshare(): MRB_API void mrb_env_unshare(mrb_state *mrb, struct REnv *e) { size_t len = (size_t)MRB_ENV_STACK_LEN(e); // p is NULL in this case mrb_value *p = (mrb_value *)mrb_malloc(mrb, sizeof(mrb_value)*len); MRB_ENV_UNSHARE_STACK(e); if (len > 0) { stack_copy(p, e->stack, len); // p is NULL but used. It causes SEGV. } e->stack = p; mrb_write_barrier(mrb, (struct RBasic *)e); } To solve the SEGV, this change always raises NoMemoryError even when realloc() is failed after the first NoMemoryError in mrb_realloc(). mrb_unv_unshare() doesn't need to check NULL with this change. But it causes infinite loop in the following while: L_RAISE: // ... while (ci[0].ridx == ci[-1].ridx) { cipop(mrb); // ... } Because cipop() never pops ci. This change includes cipop() change. The change pops ci even when mrb_unv_unshare() is failed by NoMemoryError. This case can be reproduced by the following program: #include <stdlib.h> #include <mruby.h> #include <mruby/compile.h> static void * allocf(mrb_state *mrb, void *ptr, size_t size, void *ud) { static mrb_bool always_fail = FALSE; if (size == 1001) { always_fail = TRUE; } if (always_fail) { return NULL; } if (size == 0) { free(ptr); return NULL; } else { return realloc(ptr, size); } } int main(int argc, char **argv) { mrb_state *mrb; mrbc_context *c; FILE *file; mrb = mrb_open_allocf(allocf, NULL); c = mrbc_context_new(mrb); file = fopen(argv[1], "r"); mrb_load_file_cxt(mrb, file, c); fclose(file); mrbc_context_free(mrb, c); mrb_close(mrb); return EXIT_SUCCESS; } Try the following command lines: % cc -I include -L build/host/lib -O0 -g3 -o no-memory no-memory.c -lmruby -lm % ./no-memory segv.rb
2016-01-18Merge pull request #3086 from pra85/2016Yukihiro "Matz" Matsumoto
Update license year range to 2016
2016-01-18Update license year range to 2016Prayag Verma
2016-01-14Merge pull request #3084 from syohex/all-zerosYukihiro "Matz" Matsumoto
Fix passing all zero string to Kernel#Integer
2016-01-14Fix all zero string caseSyohei YOSHIDA