stevedlawrence commented on code in PR #833:
URL: https://github.com/apache/daffodil/pull/833#discussion_r955044825
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/unparsers/UState.scala:
##########
@@ -394,8 +397,10 @@ final class UStateForSuspension(
extends UState(vbox, mainUState.diagnostics, mainUState.dataProc, tunable,
areDebugging) {
dState.setMode(UnparserBlocking)
- dState.setCurrentNode(thisElement.asInstanceOf[DINode])
- dState.setContextNode(thisElement.asInstanceOf[DINode])
+ if (currentInfosetNodeMaybe.isDefined) {
+ dState.setCurrentNode(thisElement.asInstanceOf[DINode])
+ dState.setContextNode(thisElement.asInstanceOf[DINode])
+ }
Review Comment:
After talking this morning, and thinking about this some more, I believe
this is incorrect. In order to not have a DINode in when a UStateForSuspension
is created, it must mean we are creating a suspension after unparsing has
completed. The the only way that could happen is if we are creating a
suspension from within another suspension that is evaluting at the end of
unparse, which should never be allowed. So to have a UStateForSuspension
without a currentNode implies there was some other invariant that isn't holding
that we just aren't checking for.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]