diff options
| -rw-r--r-- | .github/workflows/oss-fuzz.yml | 2 | ||||
| -rw-r--r-- | .pre-commit-config.yaml | 2 | ||||
| -rw-r--r-- | CONTRIBUTING.md | 2 | ||||
| -rw-r--r-- | doc/guides/compile.md | 8 | ||||
| -rw-r--r-- | doc/guides/mrbgems.md | 4 | ||||
| -rwxr-xr-x | minirake | 2 | ||||
| -rw-r--r-- | src/class.c | 2 | ||||
| -rw-r--r-- | src/variable.c | 16 |
8 files changed, 20 insertions, 18 deletions
diff --git a/.github/workflows/oss-fuzz.yml b/.github/workflows/oss-fuzz.yml index e693b913d..739e4afad 100644 --- a/.github/workflows/oss-fuzz.yml +++ b/.github/workflows/oss-fuzz.yml @@ -16,7 +16,7 @@ jobs: fuzz-seconds: 600 dry-run: false - name: Upload Crash - uses: actions/[email protected] + uses: actions/[email protected] if: failure() with: name: artifacts diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a274930e7..c4821ba62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,9 @@ repos: - id: check-executables-have-shebangs exclude: ^test/t/lang\.rb$ - id: check-merge-conflict + - id: check-vcs-permalinks - id: check-yaml + - id: detect-private-key - id: end-of-file-fixer - id: fix-byte-order-marker - id: mixed-line-ending diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c49d8dd15..39fd6504c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ things in mind before submitting your pull request: * Work on the latest possible state of **mruby/master** * Create a branch which is dedicated to your change -* Test your changes before creating a pull request (```rake test```) +* Test your changes before creating a pull request (`rake test`) * If possible write a test case which confirms your change * Don't mix several features or bug-fixes in one pull request * Create a meaningful commit message diff --git a/doc/guides/compile.md b/doc/guides/compile.md index 08dbd850f..2923a2676 100644 --- a/doc/guides/compile.md +++ b/doc/guides/compile.md @@ -138,18 +138,18 @@ C Compiler has header searcher to detect installed library. If you need an include path of header file use `search_header_path`: ```ruby -# Searches ```iconv.h```. +# Searches `iconv.h`. # If found it will return include path of the header file. -# Otherwise it will return nil . +# Otherwise it will return nil. fail 'iconv.h not found' unless conf.cc.search_header_path 'iconv.h' ``` If you need a full file name of header file use `search_header`: ```ruby -# Searches ```iconv.h```. +# Searches `iconv.h`. # If found it will return full path of the header file. -# Otherwise it will return nil . +# Otherwise it will return nil. iconv_h = conf.cc.search_header 'iconv.h' print "iconv.h found: #{iconv_h}\n" ``` diff --git a/doc/guides/mrbgems.md b/doc/guides/mrbgems.md index 9aebb9208..88c5aedba 100644 --- a/doc/guides/mrbgems.md +++ b/doc/guides/mrbgems.md @@ -55,8 +55,8 @@ conf.gem mgem: 'mruby-redis', checksum_hash: '3446d19fc4a3f9697b5ddbf2a904f301c4 If there are missing dependencies, mrbgem dependencies solver will reference mrbgem from the core or mgem-list. -To pull all gems from remote GIT repository on build, call ```rake -p```, -or ```rake --pull-gems```. +To pull all gems from remote GIT repository on build, call `rake -p`, +or `rake --pull-gems`. NOTE: `:bitbucket` option supports only git. Hg is unsupported in this version. @@ -1,2 +1,2 @@ -#! /usr/bin/env ruby +#!/usr/bin/env ruby exec "rake", *ARGV diff --git a/src/class.c b/src/class.c index 30e2b2603..f02e280ef 100644 --- a/src/class.c +++ b/src/class.c @@ -1435,7 +1435,7 @@ fix_include_module(mrb_state *mrb, struct RBasic *obj, void *data) { struct RClass **m = (struct RClass**)data; - if (obj->tt == MRB_TT_ICLASS && obj->c == m[0] && (obj->flags & MRB_FL_CLASS_IS_ORIGIN) == 0) { + if (obj->tt == MRB_TT_ICLASS && obj->c == m[0] && !MRB_FLAG_TEST(obj, MRB_FL_CLASS_IS_ORIGIN)) { struct RClass *ic = (struct RClass*)obj; include_module_at(mrb, ic, ic, m[1], 1); } diff --git a/src/variable.c b/src/variable.c index 646353bfd..d89295229 100644 --- a/src/variable.c +++ b/src/variable.c @@ -766,16 +766,17 @@ mod_const_check(mrb_state *mrb, mrb_value mod) } static mrb_value -const_get(mrb_state *mrb, struct RClass *base, mrb_sym sym) +const_get(mrb_state *mrb, struct RClass *base, mrb_sym sym, mrb_bool skip) { struct RClass *c = base; mrb_value v; mrb_bool retry = FALSE; mrb_value name; + if (skip) c = c->super; L_RETRY: while (c) { - if (c->iv) { + if (!MRB_FLAG_TEST(c, MRB_FL_CLASS_IS_PREPENDED) && c->iv) { if (iv_get(mrb, c->iv, sym, &v)) return v; } @@ -794,7 +795,7 @@ MRB_API mrb_value mrb_const_get(mrb_state *mrb, mrb_value mod, mrb_sym sym) { mod_const_check(mrb, mod); - return const_get(mrb, mrb_class_ptr(mod), sym); + return const_get(mrb, mrb_class_ptr(mod), sym, FALSE); } mrb_value @@ -803,9 +804,9 @@ mrb_vm_const_get(mrb_state *mrb, mrb_sym sym) struct RClass *c; struct RClass *c2; mrb_value v; - const struct RProc *proc; + const struct RProc *proc = mrb->c->ci->proc; - c = MRB_PROC_TARGET_CLASS(mrb->c->ci->proc); + c = MRB_PROC_TARGET_CLASS(proc); if (!c) c = mrb->object_class; if (iv_get(mrb, c->iv, sym, &v)) { return v; @@ -821,8 +822,7 @@ mrb_vm_const_get(mrb_state *mrb, mrb_sym sym) c2 = mrb_class_ptr(klass); } if (c2 && (c2->tt == MRB_TT_CLASS || c2->tt == MRB_TT_MODULE)) c = c2; - mrb_assert(!MRB_PROC_CFUNC_P(mrb->c->ci->proc)); - proc = mrb->c->ci->proc; + proc = proc->upper; while (proc) { c2 = MRB_PROC_TARGET_CLASS(proc); if (c2 && iv_get(mrb, c2->iv, sym, &v)) { @@ -830,7 +830,7 @@ mrb_vm_const_get(mrb_state *mrb, mrb_sym sym) } proc = proc->upper; } - return const_get(mrb, c, sym); + return const_get(mrb, c, sym, TRUE); } MRB_API void |
