duktape icon indicating copy to clipboard operation
duktape copied to clipboard

An issue about the unsigned right shift operator

Open YaoHouyou opened this issue 3 years ago • 1 comments

Version

2.6.0

Overview

According to the ES5 standard, a>>>(a=2) where the initial value of a is 4 and the result should be 1, but the result of duktape is 0. So I think there is a problem here.

Testcase

var NISLFuzzingFunc = function () {

	var a = 4; 	
	return a >>> (a = 2);
};
var NISLCallingResult = NISLFuzzingFunc();

print(NISLCallingResult);

Actual Results

0

Expected Results

1

YaoHouyou avatar Mar 03 '21 11:03 YaoHouyou

There seems to be a bug in the evaluation when 'a' is register based. If it's e.g. a global variable the expected result happens.

Thanks, I'll check this out.

svaarala avatar Mar 04 '21 20:03 svaarala