chakra-core / chakra-core/ChakraCore
incorrect result with unsigned right shift operator
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
This poc will output different results in the JIT compiler.
```js
function test2(a) {
if ((a | 0) >>> 0 > (11569 | -29007) >>> 0)
return true;
else
return false;
}
for (var i = 0; i < 10; i++) {
print(test2(-1))
}
```
run with command in current master branch(`commit 41ad58a9eebf8d52a83424c8fccfaacdb14105ec`):
```
Build\VcBuild\bin\x64_debug\ch.exe test.js -bgjit- -mic:5 -off:simplejit
```
output:
```
true
true
true
true
true
false
false
false
false
false
```
Contributor guide
Research direction
Start by reproducing test.js with the provided ChakraCore commit and command, including the JIT options, and compare the repeated results. Trace the unsigned right-shift expression through the JIT compiler; done means the test produces the correct consistent result across all iterations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, javascript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100