diff options
| author | Koichi Sasada <ko1@atdot.net> | 2023-12-20 03:45:41 +0900 |
|---|---|---|
| committer | Koichi Sasada <ko1@atdot.net> | 2023-12-20 07:04:32 +0900 |
| commit | 054f56fd3e5bf84e5443896fd1f4e439c2773c60 (patch) | |
| tree | 8bff47e38798715e5037d4d025b8fd8a10259d59 | |
| parent | 7a0dfdea8c92d2393d624bc7961f36e082c43471 (diff) | |
moved object should not have a shape ID
fix [Bug #19917]
| -rw-r--r-- | bootstraptest/test_ractor.rb | 18 | ||||
| -rw-r--r-- | ractor.c | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index 36ccc005dc..4383795dc1 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -1643,6 +1643,24 @@ assert_match /\Atest_ractor\.rb:1:\s+warning:\s+Ractor is experimental/, %q{ eval("Ractor.new{}.take", nil, "test_ractor.rb", 1) } +# check moved object +assert_equal 'ok', %q{ + r = Ractor.new do + Ractor.receive + GC.start + :ok + end + + obj = begin + raise + rescue => e + e = Marshal.load(Marshal.dump(e)) + end + + r.send obj, move: true + r.take +} + ## Ractor::Selector # Selector#empty? returns true @@ -3491,6 +3491,8 @@ ractor_moved_bang(VALUE obj) rv->v3 = 0; rv->flags = rv->flags & ~fl_users; + if (BUILTIN_TYPE(obj) == T_OBJECT) ROBJECT_SET_SHAPE_ID(obj, ROOT_SHAPE_ID); + // TODO: record moved location } |
