HaxeFoundation / HaxeFoundation/haxe

[python] "<Int32> |= <Int>" not clamping result to 32 bits

Open
#5,938 3 comments 0 reactions 1 assignee Claimed by @hughsando View on GitHub
platform-cpp
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Code to reproduce:
```haxe
import haxe.Int32;

class Test {
static function main():Void {
var i32:Int32 = 15459750;
var arr:Array = [178,0,0];
var next = 0;

i32 |= (arr[next] << 24);

trace(i32);
}
}
```

Expected: `-1293163098`
Actual: `3001804198`

Tested on haxe 3.4rc, win7 64bit

Notes: works correctly on lua and neko

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.