Integer promotion problems, part deux #120
Labels
bug
concrete-issue
An actionable, concrete issue that includes stack trace & technical details. Usually post-triage
After creating the issue, checkboxes will appear where
[] label
exist in themarkdown. You can check/uncheck them to fill out the environment section.
Describe the bug
Pfp doesn't correctly handle integer promotion. E.g. this should print
10,896
Currently, the output in pfp is
10,128
.Stack Trace
None
Expected Behavior
Should have the same integer promotion as C and 010 Editor
Implementation/Fix Notes/Thoughts
In the statement
local uint test2 = (uint)((cur & 0x7f) << 7);
,cur
and0x7f
are treated asubyte
types and aren't promoted until the cast occurs. The promotion needs to happen before operations occur, so that the&
and the<<
binary operators operate on the target cast typeuint
, and not the original types (ubyte
)The text was updated successfully, but these errors were encountered: