Skip to content

musl-translated code needs to be re-audited for correctness  #19476

@expikr

Description

@expikr

While reworking hypot I spotted an error in the auto-translated code deviating from the original behaviour due to function argument mutability, causing the function to produce completely nonsensical answers triggered by the very logic that was specifically meant to guard against those over/underflow cases.

The behaviour had been overlooked because the tests did not test for the actual over/underflow cases.

This kind of calls into question for how many lost-in-translation correctness errors arising from the auto-porting process have been overlooked.

It might be a good idea to keep track of which of the musl code are verified to have been ported correctly, and which of them pends reexamination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions