-
Notifications
You must be signed in to change notification settings - Fork 366
[OM] Ensure every sublist is finished in ListConcatOp evaluation. #8460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We would previously check if the value corresponding to each operand of the ListConcatOp was finished evaluating, but in the case where the operand is a ReferenceValue, the reference may be done evaluating before while the underlying ListValue is not. To handle this, a check was added that the result of extractList is fully evaluated, and the evaluation of the ListConcatOp doesn't proceed until that is true. A small unit test shows this scenario, where there are object references in lists passed as field references to a ListConcatOp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one comment about the test.
Although I can't see it based on the code shown here, I'm guessing the surrounding context will evaluate these values using a worklist style algorithm until everything is fully evaluated? So that makes returning the unevaluated list work since it will come back around and try again once the dependent values have been evaluated.
auto finalList = | ||
llvm::cast<evaluator::ListValue>(fieldValue.get())->getElements(); | ||
|
||
ASSERT_EQ(2U, finalList.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's worth checking the list contents are what we expect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure yeah let me do something with the object references to test that we got the two expected objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new field to each object so I could check the value of that field in the test.
Yep that's exactly how it works. You can return a value with the "is fully evaluated" flag set false to indicate that this needs to go back at the end of the worklist. |
…vm#8460) We would previously check if the value corresponding to each operand of the ListConcatOp was finished evaluating, but in the case where the operand is a ReferenceValue, the reference may be done evaluating before while the underlying ListValue is not. To handle this, a check was added that the result of extractList is fully evaluated, and the evaluation of the ListConcatOp doesn't proceed until that is true. A small unit test shows this scenario, where there are object references in lists passed as field references to a ListConcatOp.
We would previously check if the value corresponding to each operand of the ListConcatOp was finished evaluating, but in the case where the operand is a ReferenceValue, the reference may be done evaluating before while the underlying ListValue is not.
To handle this, a check was added that the result of extractList is fully evaluated, and the evaluation of the ListConcatOp doesn't proceed until that is true.
A small unit test shows this scenario, where there are object references in lists passed as field references to a ListConcatOp.