olabusayoT commented on code in PR #1717:
URL: https://github.com/apache/daffodil/pull/1717#discussion_r3864899296
##########
daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/DPathRuntime.scala:
##########
@@ -205,7 +206,11 @@ case class VRef(vrd: VariableRuntimeData, context:
ThrowsSDE) extends RecipeOp {
override def run(dstate: DState): Unit = {
if (dstate.parseOrUnparseState.isEmpty)
- throw new VariableHasNoValue(vrd.globalQName, vrd)
+ // No live parse/unparse state to look up the real VariableInstance
+ // in, so there's nothing a targeted wake-up could ever register
+ // against anyway; a fresh, disconnected instance is a harmless
+ // placeholder here.
Review Comment:
So parseOrUnparseState is empty only when dstate is a
DStateForConstantFolding, constructed exclusively inside
DPathRuntime.runExpressionForConstant. That method's own catch block (case
_: VariableException => false) discards the exception immediately, never
reaching any suspension-registration
code; so the placeholder really is inert, but only for that specific,
narrow reason. the comment has been expanded to say so explicitly instead of
just asserting "harmless."
--
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]