Fix incorrect OtherContextException wrapper when the exception comes back to its creator context#13454
Fix incorrect OtherContextException wrapper when the exception comes back to its creator context#13454eregon wants to merge 3 commits into
Conversation
| // TODO: Should the last arg be valueContext like in migrateValue? | ||
| throw new OtherContextException(receiverContext, other.delegate, other.delegateContext); |
There was a problem hiding this comment.
migrateValue() does:
(in migrateValue(), this == receiverContext)
Which is correct?
I'm not sure what the receiverContext is for, wouldn't only tracking the delegateContext be enough?
Is it because the OtherContextGuestObject/OtherContextException objects need to belong to one context and not many? (if so, is that needed?)
There was a problem hiding this comment.
I (and Codex) have figured this out, it was another bug, this time in migrateValue().
Pushed a commit with a fix + test and verified the test passes with the fix and fails without.
8902d38 to
2f63ee5
Compare
|
Ah during rebasing I noticed @iamstolis already fixed the second bug in 5b5c93a / #13522. |
…back to its creator context
2f63ee5 to
bae99da
Compare
tzezula
left a comment
There was a problem hiding this comment.
Looks good to me.
It unwraps the object originated in the targetContext rather than creating a decorator chain.
|
lgtm. inbounding the PR. sorry for the delay. |
|
PR is merged here: #13599 |
Summary
Fixes #13453
Testing
I wrote a test for this in
truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/TruffleContextTest.javawith the help of Codex. It passes with the fix and fails without.I also have tests in TruffleRuby for this: https://github.com/truffleruby/truffleruby/pull/4235/changes
I confirm this PR fixes #13453, as in those tests fail without and pass with this PR.
Documentation
No documentation updates are needed.
Contributor Checklist