Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert cc cme nonull #5122

Merged
merged 6 commits into from
Nov 17, 2021
Merged

Assert cc cme nonull #5122

merged 6 commits into from
Nov 17, 2021

Conversation

ko1
Copy link
Contributor

@ko1 ko1 commented Nov 16, 2021

Recently cc->cme_ (rb_callcache::cme_) points NULL, but cached cme_ should not be NULL (when it is markable).
This PR fixes the invariant violation.

@ko1 ko1 force-pushed the assert_cc_cme_nonull branch 4 times, most recently from 2415795 to bbbce9a Compare November 16, 2021 21:48
@ko1
Copy link
Contributor Author

ko1 commented Nov 17, 2021

on windows:

https://github.com/ruby/ruby/runs/4230922396?check_suite_focus=true#step:17:917

    1) Error:
  TestRefinement#test_refine_recursion:
  NoMethodError: undefined method `recursive_length' for "oo":String
      D:/a/ruby/ruby/src/test/ruby/test_refinement.rb:683:in `recursive_length'
      (eval):1:in `<module:Sandbox>'
      D:/a/ruby/ruby/src/test/ruby/test_refinement.rb:2678:in `eval'
      D:/a/ruby/ruby/src/test/ruby/test_refinement.rb:2678:in `eval_using'
      D:/a/ruby/ruby/src/test/ruby/test_refinement.rb:690:in `test_refine_recursion'

Same as `vm_empty_cc`, introduce a global variable which has
`.call_ = vm_call_super_method`. Use it if the `cme == NULL` on
`vm_search_super_method`.
when `vm_cc_markable(cc)`.
check if iseq refers to on stack CC (it shouldn't).
Now `cc->cme_` is not NULL.
@ko1
Copy link
Contributor Author

ko1 commented Nov 17, 2021

@ko1 ko1 marked this pull request as ready for review November 17, 2021 04:29
@ko1 ko1 merged commit b95d7d2 into ruby:master Nov 17, 2021
peterzhu2118 added a commit to Shopify/ruby that referenced this pull request Nov 17, 2021
Tests for GitHub PR ruby#5122. Originally in GitHub PR ruby#5121.
peterzhu2118 added a commit to Shopify/ruby that referenced this pull request Nov 17, 2021
Tests for GitHub PR ruby#5122. Originally in GitHub PR ruby#5121.
peterzhu2118 added a commit that referenced this pull request Nov 17, 2021
Tests for GitHub PR #5122. Originally in GitHub PR #5121.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant