Skip to content

implicit conversion in asm/preproc.c #210

@xmoezzz

Description

@xmoezzz

Hi,

I found a sanitizer-detected implicit conversion issue in nasm 3.01rc7, and it is also present in the current master branch.

UBSan reports:

/root/build/nasm-nasm-3.01rc7/asm/preproc.c:8238:26: runtime error: implicit conversion from type 'int' of value -57 (32-bit, signed) to type 'unsigned int' changed the value to 4294967239 (32-bit, unsigned)

The code at this location is:

flags &= ~(SPARM_GREEDY|SPARM_VARADIC|SPARM_OPTIONAL);

This seems to come from applying ~ to the flag mask expression, which produces a negative signed intermediate value before the &= operation.

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