You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "mbeckerle (via GitHub)" <gi...@apache.org> on 2023/02/07 17:29:46 UTC

[GitHub] [daffodil] mbeckerle commented on a diff in pull request #949: Fix overflow in DataLoc positions

mbeckerle commented on code in PR #949:
URL: https://github.com/apache/daffodil/pull/949#discussion_r1098982761


##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/DataLoc.scala:
##########
@@ -49,9 +49,9 @@ class DataLoc(
   Assert.usage(bitLimit1b.isEmpty || bitLimit1b.get >= 0)
   Assert.usage(bitPos1b >= 1)
 
-  val bitPos0b = math.max(bitPos1b - 1, 0).toInt
+  val bitPos0b = bitPos1b - 1

Review Comment:
   I think it is worth it to add the type declaration of Long to these members. Especially public ones. 



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org