Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect ToInt32 semantics #160

Closed
ruben-ayrapetyan opened this issue Jun 9, 2015 · 1 comment
Closed

Incorrect ToInt32 semantics #160

ruben-ayrapetyan opened this issue Jun 9, 2015 · 1 comment
Assignees
Labels
bug Undesired behaviour critical Raises security concerns ecma core Related to core ECMA functionality

Comments

@ruben-ayrapetyan
Copy link
Contributor

Hello.

The following unit test fails on armv7-hf linux build and on x86_64 in unittests mode build (unit tests are built with O3):

  ecma_number_t m2 = (ecma_number_t) -2.0;
  JERRY_ASSERT (ecma_number_to_int32 (m2) == -2);

Seems that ecma_number_to_int32 is implemented incorrectly.

@ruben-ayrapetyan ruben-ayrapetyan added bug Undesired behaviour ecma core Related to core ECMA functionality labels Jun 9, 2015
@ruben-ayrapetyan ruben-ayrapetyan added this to the Core ECMA features milestone Jun 9, 2015
@egavrin egavrin added the critical Raises security concerns label Jun 19, 2015
ruben-ayrapetyan added a commit that referenced this issue Jun 22, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
ruben-ayrapetyan added a commit that referenced this issue Jun 22, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
ruben-ayrapetyan added a commit that referenced this issue Jun 22, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
@ruben-ayrapetyan
Copy link
Contributor Author

Cause of failure: behaviour of C++ conversion from float to integer type is undefined, if floating point value without fractional part cannot be represented in destination type (4.9. Floating-integral conversions).

Pull request with fix: #226

@egavrin egavrin assigned ruben-ayrapetyan and unassigned egavrin Jun 22, 2015
ruben-ayrapetyan added a commit that referenced this issue Jun 23, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
ruben-ayrapetyan added a commit that referenced this issue Jun 23, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
ruben-ayrapetyan added a commit that referenced this issue Jun 23, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
ruben-ayrapetyan added a commit that referenced this issue Jun 23, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
ruben-ayrapetyan added a commit that referenced this issue Jun 23, 2015
…nt32) conversion routines.

Related issue: #160

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour critical Raises security concerns ecma core Related to core ECMA functionality
Projects
None yet
Development

No branches or pull requests

2 participants