summaryrefslogtreecommitdiff
path: root/ext/io/console
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-09-09 10:15:07 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-09-09 14:26:57 -0700
commitd8a4af47a5e5f72be2cd2897712d1718013b2e4c (patch)
tree5a8361bc7547a3738ebd77be54f9ed6124735917 /ext/io/console
parent4524780d1795e750e23896866eb447be2670ddcd (diff)
Only use `add_mark_object` in Ripper
This patch changes parse.y to only use `add_mark_object` in Ripper. Previously we were seeing a bug in write barrier verification. I had changed `add_mark_object` to execute the write barrier, but the problem is that we had code like this: ``` NEW_STR(add_mark_object(p, obj), loc) ``` In this case, `add_mark_object` would execute the write barrier between the ast and `obj`, but the problem is that `obj` isn't actually reachable from the AST at the time the write barrier executed. `NEW_STR` can possibly call `malloc` which can kick a GC, and since `obj` isn't actually reachable from the AST at the time of WB execution, verification would fail. Basically the steps were like this: 1. RB_OBJ_WRITTEN via `add_mark_object` 2. Allocate node 3. *Possibly* execute GC via malloc 4. Write obj in to allocated node This patch changes the steps to: 1. Allocate node 2. *Possibly* execute GC via malloc 3. Write obj in to allocated node 4. RB_OBJ_WRITTEN
Diffstat (limited to 'ext/io/console')
0 files changed, 0 insertions, 0 deletions