lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-6409) LongBitSet.ensureCapacity overflows on numBits > Integer.MaxValue
Date Wed, 08 Apr 2015 14:42:12 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-6409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485313#comment-14485313
] 

Adrien Grand commented on LUCENE-6409:
--------------------------------------

Thanks for the fixes! I'm wondering that this new approach might cause bugs if you create
bit sets of length 0. Can you add tests for this case too?

>  LongBitSet.ensureCapacity overflows on numBits > Integer.MaxValue 
> -------------------------------------------------------------------
>
>                 Key: LUCENE-6409
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6409
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/other
>            Reporter: Luc Vanlerberghe
>
> LongBitSet.ensureCapacity calculates the number of longs required to store the number
of bits correctly and allocates a long[] accordingly, but then shifts the array length (which
is an int!) left by 6 bits.  The int should be cast to long *before* performing the shift.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message