Skip to content

UnaryOp '!' stores result back into non-boolean variables incorrectly #245

@yuvimittal

Description

@yuvimittal

Summary

The NOT operator XORs the value with constant 1, which is correct for i1. But the code then stores the result back into the variable address regardless of type. For an i32 or i64 variable this produces a type mismatch store and corrupts the value semantics (XOR with 1 on an i32 flips only the LSB, not a logical NOT).

OS / Environment

-

Steps to Reproduce

File Upload (optional)

No response

Expected Results

Actual Results

-

IRx version

-

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions