diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2023-11-30 10:51:51 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2023-12-01 17:13:56 -0500 |
| commit | 0aed37b973c66e9ff071a1f46944cb0c6151d2dc (patch) | |
| tree | e6f785c47230ebeb7ad341e61495bfaa73b1c32e /doc/optparse/ruby/array.rb | |
| parent | 492c82cb417a92d1941f10b52e77ec0c4b2cc8a6 (diff) | |
Make expandarray compaction safe
The expandarray instruction can allocate an array, which can trigger
a GC compaction. However, since it does not increment the sp until the
end of the instruction, the objects it places on the stack are not
marked or reference updated by the GC, which can cause the objects to
move which leaves broken or incorrect objects on the stack.
This commit changes the instruction to be handles_sp so the sp is
incremented inside of the instruction right after the object is written
on the stack.
Diffstat (limited to 'doc/optparse/ruby/array.rb')
0 files changed, 0 insertions, 0 deletions
