[ 
https://issues.apache.org/jira/browse/BEAM-7364?focusedWorklogId=244955&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-244955
 ]

ASF GitHub Bot logged work on BEAM-7364:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/May/19 09:35
            Start Date: 20/May/19 09:35
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on pull request #8593: [BEAM-7364] 
Avoid possible signed integer overflow in hash.
URL: https://github.com/apache/beam/pull/8593#discussion_r285504456
 
 

 ##########
 File path: sdks/python/apache_beam/utils/windowed_value.py
 ##########
 @@ -202,10 +202,10 @@ def __ne__(self, other):
     return not self == other
 
   def __hash__(self):
-    return (hash(self.value) +
-            3 * self.timestamp_micros +
-            7 * hash(self.windows) +
-            11 * hash(self.pane_info))
+    return ((hash(self.value) & 0xFFFFFFFFFFFFFFF +
+            3 * (self.timestamp_micros & 0xFFFFFFFFFFFFFF) +
 
 Review comment:
   Yes, but when compiled some C tools will complain about this. 
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 244955)
            Time Spent: 10m
    Remaining Estimate: 0h

> Possible signed overflow for WindowedValue.__hash__
> ---------------------------------------------------
>
>                 Key: BEAM-7364
>                 URL: https://issues.apache.org/jira/browse/BEAM-7364
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py-core
>            Reporter: Robert Bradshaw
>            Assignee: Robert Bradshaw
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to