You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no constants are generated the value is correctly cast to c_short before being widened back: 0x8000 as libc::c_int as libc::c_short as libc::c_int
When constant translation is enabled, however, the 0x8000 constant is not cast to the short type and stored directly as an int, which is incorrect
The text was updated successfully, but these errors were encountered:
DCNick3
added a commit
to DCNick3/unsafe-libopus
that referenced
this issue
Feb 24, 2023
A bug I found when working on unsafe-libopus
Apparently, when const macro translation is enabled, some casts are dropped, which leads to a change in semantics.
Reproducible case
Without
--translate-const-macros
:Outputs
-32768
With
--translate-const-macros
:Outputs
32768
The bug
When no constants are generated the value is correctly cast to
c_short
before being widened back:0x8000 as libc::c_int as libc::c_short as libc::c_int
When constant translation is enabled, however, the
0x8000
constant is not cast to theshort
type and stored directly as an int, which is incorrectThe text was updated successfully, but these errors were encountered: