olabusayoT commented on code in PR #1338:
URL: https://github.com/apache/daffodil/pull/1338#discussion_r1803502665


##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/SpecifiedLengthParsers.scala:
##########
@@ -85,7 +85,9 @@ sealed abstract class SpecifiedLengthParserBase(eParser: 
Parser, erd: RuntimeDat
     if (pState.processorStatus ne Success) return
     val finalEndPos0b = startingBitPos0b + nBits
 
-    captureValueLength(pState, ULong(startingBitPos0b), ULong(dis.bitPos0b))
+    // if we haven't already set the value length, set it now
+    if (pState.infoset.valueLength.isEndUndef)
+      captureValueLength(pState, ULong(startingBitPos0b), ULong(dis.bitPos0b))

Review Comment:
   > ElementBaseRuntime1Mixin has a capturedByParsers val that tries to list 
which parsers capture their own value length. Maybe that logic isn't completely 
correct, and the work around (that feels wrong) is we just always capture the 
length here?
   
   I think it's the "isReferenced" boolean that may be the issue, if we remove 
that, then we'll always captureValueLength if capturedByParsers is false



-- 
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]

Reply via email to