Skip to content

Potential infinite loop in Real.hpp #39

@Thiesius

Description

@Thiesius

There is a possibility of infinite loop in Real.hpp. if the first part of the condition (first_byte & 0xF0) == 0 evaluates as true and exponent is bigger than 0, then for obvious reasons (exponent -= 0) loop never ends.

   /* Mantissa is too small - shift left up to 4 bits */
    int          shift      = 8;
    unsigned int first_byte = double_bytes[1];

    /* Adapt exponent */
    while ((first_byte & 0xF0) == 0 && exponent > (8 - shift))
    {
        exponent -= 8 - shift;
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions