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

EmptyValue is recognized as a PointerValue in 64bit mode #552

Open
clover2123 opened this issue Jan 22, 2020 · 0 comments
Open

EmptyValue is recognized as a PointerValue in 64bit mode #552

clover2123 opened this issue Jan 22, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@clover2123
Copy link
Contributor

clover2123 commented Jan 22, 2020

Escargot

  • OS: Ubuntu 18.04 (x64)

Describe the bug
EmptyValue is recognized as a PointerValue in 64bit mode.
Especially, Value::isPointerValue() returns true result for EmptyValue.

Analysis

inline bool Value::isPointerValue() const
{
    return !(u.asInt64 & TagMask);
}

EmptyValue has 0 (null) value in itself. Therefore the result of u.asInt64 & TagMask operation always false and isPointerValue() returns true.
If I simply fix the check code as follow, octane score is dropped by 20 points.

inline bool Value::isPointerValue() const
{
    return !(u.asInt64 & TagMask) && u.ptr;
}

EmptyValue is not one of JavaScript types and used only inside the Escargot engine to represent invalid values such as array holes, uninitialized values etc. So there is no critical problem right now. But I write this issue to alert that PointerValue and EmptyValue should not be used together. Or at least, PointerValue check(isPointerValue) should not be called for EmptyValue. We may resolve this issue later.

@clover2123 clover2123 added the bug Something isn't working label Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant