Guest User

Untitled

a guest
Jun 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. --- a/compile.c 2018-05-13 19:35:50.000000000 -0700
  2. +++ b/compile.c 2018-05-13 19:34:53.000000000 -0700
  3. @@ -4569,6 +4569,7 @@
  4. DECL_ANCHOR(else_seq);
  5. LABEL *then_label, *else_label, *end_label;
  6. VALUE branches = 0;
  7. + int ci_size, ci_kw_size;
  8.  
  9. INIT_ANCHOR(cond_seq);
  10. INIT_ANCHOR(then_seq);
  11. @@ -4579,8 +4580,20 @@
  12.  
  13. compile_branch_condition(iseq, cond_seq, node->nd_cond,
  14. then_label, else_label);
  15. + ci_size = iseq->body->ci_size;
  16. + ci_kw_size = iseq->body->ci_kw_size;
  17. CHECK(COMPILE_(then_seq, "then", node_body, popped));
  18. + if (!then_label->refcnt) {
  19. + iseq->body->ci_size = ci_size;
  20. + iseq->body->ci_kw_size = ci_kw_size;
  21. + }
  22. + ci_size = iseq->body->ci_size;
  23. + ci_kw_size = iseq->body->ci_kw_size;
  24. CHECK(COMPILE_(else_seq, "else", node_else, popped));
  25. + if (!else_label->refcnt) {
  26. + iseq->body->ci_size = ci_size;
  27. + iseq->body->ci_kw_size = ci_kw_size;
  28. + }
  29.  
  30. ADD_SEQ(ret, cond_seq);
  31.  
  32. @@ -8513,6 +8526,7 @@
  33. for (i=0; i<ci_kw_size; i++) {
  34. const struct rb_call_info_kw_arg *kw_arg = dump_ci_kw_entries[i].kw_arg;
  35. int j;
  36. + assert(kw_arg != NULL);
  37. VALUE *keywords = ALLOCA_N(VALUE, kw_arg->keyword_len);
  38. for (j=0; j<kw_arg->keyword_len; j++) {
  39. keywords[j] = (VALUE)ibf_dump_object(dump, kw_arg->keywords[j]); /* kw_arg->keywords[n] is Symbol */
  40. @@ -8622,7 +8636,15 @@
  41. rb_raise(rb_eRuntimeError, "path object size mismatch");
  42. }
  43. path = rb_fstring(RARRAY_AREF(pathobj, 0));
  44. - realpath = rb_fstring(RARRAY_AREF(pathobj, 1));
  45. + realpath = RARRAY_AREF(pathobj, 1);
  46. + if (!NIL_P(realpath)) {
  47. + if (!RB_TYPE_P(realpath, T_STRING)) {
  48. + rb_raise(rb_eArgError, "unexpected realpath %"PRIxVALUE
  49. + "(%x), path=%+"PRIsVALUE,
  50. + realpath, TYPE(realpath), path);
  51. + }
  52. + realpath = rb_fstring(realpath);
  53. + }
  54. }
  55. else {
  56. rb_raise(rb_eRuntimeError, "unexpected path object");
Add Comment
Please, Sign In to add comment