Skip to content

[Bug] Overflow causes weird error message in xscat #126

@ahl27

Description

@ahl27

XString_xscat seems to rely on int types. Passing in a value larger than the maximum size of an unsigned int will cause a confusing error message about negative-length vectors. Function should probably check for overflow and report a better error message.

library(Biostrings)
x <- paste(sample(DNA_BASES, 2^30, replace=TRUE), collapse="") # works with 2^30 - 1
x <- DNAString(x)
x <- xscat(x, x)
## Error in .Call2("XString_xscat", args, PACKAGE = "Biostrings") : 
##  negative length vectors are not allowed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions