[webkit-changes] [WebKit/WebKit] 509b30: Source/JavaScriptCore/wasm/generateWasm.py: return...

Conrad Kostecki noreply at github.com
Tue Jan 2 12:26:53 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 509b303bf5650710bee5e151decc1a723a54657f
      https://github.com/WebKit/WebKit/commit/509b303bf5650710bee5e151decc1a723a54657f
  Author: Conrad Kostecki <conikost at gentoo.org>
  Date:   2024-01-02 (Tue, 02 Jan 2024)

  Changed paths:
    M Source/JavaScriptCore/wasm/generateWasm.py

  Log Message:
  -----------
  Source/JavaScriptCore/wasm/generateWasm.py: return value in int for memorybits

https://bugs.webkit.org/show_bug.cgi?id=266942

Reviewed by Justin Michaud.

The assert function currently checks, if power number raised to the
number fits memorybits. This seems not always work on every system,
as it happens, that the float numbers are not correctly rounded.

This patch adds an int, so its being rounded to a full number and works
on my system, where otherwise the rounding would fail. The return method
also returns the result as an int.

Example:
import math

2 ** 3
= 8

2.0 ** 3.0
= 7.999999999999999

int(2.0) ** int(3.0)
= 8

2 ** int(3.0)
= 8

Signed-off-by: Conrad Kostecki <conikost at gentoo.org>
Canonical link: https://commits.webkit.org/272577@main




More information about the webkit-changes mailing list