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

readDoubleLE broken on 9.4.0 #18419

Closed
arthurschreiber opened this issue Jan 28, 2018 · 4 comments
Closed

readDoubleLE broken on 9.4.0 #18419

arthurschreiber opened this issue Jan 28, 2018 · 4 comments
Assignees
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs.

Comments

@arthurschreiber
Copy link

arthurschreiber commented Jan 28, 2018

  • Version: v9.4.0
  • Platform: Darwin
  • Subsystem: Buffer

It looks like #17775 might have seriously broken Buffer.prototype.readDoubleLE.

On v9.3.0:

Buffer.from([0xeb, 0x97, 0x3a, 0x98, 0x20, 0xdb, 0xc2, 0x40]).readDoubleLE();
// => 9654.254645656756

On v9.4.0:

Buffer.from([0xeb, 0x97, 0x3a, 0x98, 0x20, 0xdb, 0xc2, 0x40]).readDoubleLE();
// => -5.828774743119337e-192
@vsemozhetbyt vsemozhetbyt added the buffer Issues and PRs related to the buffer subsystem. label Jan 28, 2018
@BridgeAR
Copy link
Member

Hm, this is going to be fixed on master in #18395.

I am going to open a backport of that PR without any semver-major changes that will also fix that problem.

@BridgeAR BridgeAR self-assigned this Jan 28, 2018
@BridgeAR BridgeAR added the confirmed-bug Issues with confirmed bugs. label Jan 28, 2018
@ChALkeR
Copy link
Member

ChALkeR commented Jan 28, 2018

It looks like only the version without the offset parameter is broken?

> Buffer.from([0xeb, 0x97, 0x3a, 0x98, 0x20, 0xdb, 0xc2, 0x40]).readDoubleLE(0);
9654.254645656756
> Buffer.from([0xeb, 0x97, 0x3a, 0x98, 0x20, 0xdb, 0xc2, 0x40]).readDoubleLE();
-5.828774743119337e-192

The bad thing is that there are currently no tests for the offset-less versions of those functions.

@BridgeAR
Copy link
Member

@ChALkeR you are right and that got already fixed by #18215.

@BridgeAR
Copy link
Member

@arthurschreiber the next minor is going to contain that fix. Nevertheless it is recommended to always explicitly pass the offset. It is not meant as optional argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs.
Projects
None yet
Development

No branches or pull requests

4 participants